Jon Perritt | 23e89c3 | 2015-01-19 15:39:45 -0700 | [diff] [blame] | 1 | package flavors |
| 2 | |
| 3 | import ( |
Jon Perritt | 23e89c3 | 2015-01-19 15:39:45 -0700 | [diff] [blame] | 4 | "github.com/rackspace/gophercloud" |
| 5 | "github.com/rackspace/gophercloud/pagination" |
| 6 | ) |
| 7 | |
| 8 | // List returns a single page of CDN flavors. |
| 9 | func List(c *gophercloud.ServiceClient) pagination.Pager { |
| 10 | url := listURL(c) |
| 11 | createPage := func(r pagination.PageResult) pagination.Page { |
| 12 | return FlavorPage{pagination.SinglePageBase(r)} |
| 13 | } |
| 14 | return pagination.NewPager(c, url, createPage) |
| 15 | } |
| 16 | |
| 17 | // Get retrieves a specific flavor based on its unique ID. |
| 18 | func Get(c *gophercloud.ServiceClient, id string) GetResult { |
| 19 | var res GetResult |
Jamie Hannaford | 22aa42b | 2015-03-24 14:56:04 +0100 | [diff] [blame] | 20 | _, res.Err = c.Get(getURL(c, id), &res.Body, nil) |
Jon Perritt | 23e89c3 | 2015-01-19 15:39:45 -0700 | [diff] [blame] | 21 | return res |
| 22 | } |