Jamie Hannaford | 5b7acc1 | 2015-02-13 09:14:25 +0100 | [diff] [blame^] | 1 | package flavors |
| 2 | |
| 3 | import ( |
| 4 | "github.com/racker/perigee" |
| 5 | "github.com/rackspace/gophercloud" |
| 6 | "github.com/rackspace/gophercloud/pagination" |
| 7 | ) |
| 8 | |
| 9 | func List(client *gophercloud.ServiceClient) pagination.Pager { |
| 10 | createPage := func(r pagination.PageResult) pagination.Page { |
| 11 | return FlavorPage{pagination.LinkedPageBase{PageResult: r}} |
| 12 | } |
| 13 | |
| 14 | return pagination.NewPager(client, listURL(client), createPage) |
| 15 | } |
| 16 | |
| 17 | func Get(client *gophercloud.ServiceClient, id string) GetResult { |
| 18 | var gr GetResult |
| 19 | gr.Err = perigee.Get(getURL(client, id), perigee.Options{ |
| 20 | Results: &gr.Body, |
| 21 | MoreHeaders: client.AuthenticatedHeaders(), |
| 22 | }) |
| 23 | return gr |
| 24 | } |