Ash Wilson | 61dcb02 | 2014-10-03 08:15:47 -0400 | [diff] [blame] | 1 | package extensions |
| 2 | |
| 3 | import ( |
Ash Wilson | 61dcb02 | 2014-10-03 08:15:47 -0400 | [diff] [blame] | 4 | "github.com/rackspace/gophercloud" |
| 5 | "github.com/rackspace/gophercloud/pagination" |
| 6 | ) |
| 7 | |
| 8 | // Get retrieves information for a specific extension using its alias. |
| 9 | func Get(c *gophercloud.ServiceClient, alias string) GetResult { |
| 10 | var res GetResult |
Jamie Hannaford | 562a7d5 | 2015-03-24 16:20:16 +0100 | [diff] [blame] | 11 | _, res.Err = c.Get(ExtensionURL(c, alias), &res.Body, nil) |
Ash Wilson | 61dcb02 | 2014-10-03 08:15:47 -0400 | [diff] [blame] | 12 | return res |
| 13 | } |
| 14 | |
Ash Wilson | 8e1fc8d | 2014-10-03 08:35:33 -0400 | [diff] [blame] | 15 | // List returns a Pager which allows you to iterate over the full collection of extensions. |
| 16 | // It does not accept query parameters. |
Ash Wilson | 61dcb02 | 2014-10-03 08:15:47 -0400 | [diff] [blame] | 17 | func List(c *gophercloud.ServiceClient) pagination.Pager { |
Ash Wilson | b8b16f8 | 2014-10-20 10:19:49 -0400 | [diff] [blame] | 18 | return pagination.NewPager(c, ListExtensionURL(c), func(r pagination.PageResult) pagination.Page { |
Ash Wilson | 61dcb02 | 2014-10-03 08:15:47 -0400 | [diff] [blame] | 19 | return ExtensionPage{pagination.SinglePageBase(r)} |
| 20 | }) |
| 21 | } |