| package keypairs |
| |
| import ( |
| "github.com/racker/perigee" |
| "github.com/rackspace/gophercloud" |
| "github.com/rackspace/gophercloud/pagination" |
| ) |
| |
| // List returns a Pager that allows you to iterate over a collection of KeyPairs. |
| func List(client *gophercloud.ServiceClient) pagination.Pager { |
| return pagination.NewPager(client, listURL(client), func(r pagination.PageResult) pagination.Page { |
| return KeyPairPage{pagination.SinglePageBase(r)} |
| }) |
| } |
| |
| // Get returns public data about a previously uploaded KeyPair. |
| func Get(client *gophercloud.ServiceClient, name string) GetResult { |
| var res GetResult |
| _, res.Err = perigee.Request("GET", getURL(client, name), perigee.Options{ |
| MoreHeaders: client.AuthenticatedHeaders(), |
| Results: &res.Body, |
| OkCodes: []int{200}, |
| }) |
| return res |
| } |