Ash Wilson | 61dcb02 | 2014-10-03 08:15:47 -0400 | [diff] [blame] | 1 | package extensions |
| 2 | |
| 3 | import ( |
Jon Perritt | 27249f4 | 2016-02-18 10:35:59 -0600 | [diff] [blame] | 4 | "github.com/gophercloud/gophercloud" |
| 5 | "github.com/gophercloud/gophercloud/pagination" |
Ash Wilson | 61dcb02 | 2014-10-03 08:15:47 -0400 | [diff] [blame] | 6 | ) |
| 7 | |
| 8 | // Get retrieves information for a specific extension using its alias. |
| 9 | func Get(c *gophercloud.ServiceClient, alias string) GetResult { |
Jon Perritt | db0ae14 | 2016-03-13 00:33:41 -0600 | [diff] [blame] | 10 | var r GetResult |
| 11 | _, r.Err = c.Get(ExtensionURL(c, alias), &r.Body, nil) |
| 12 | return r |
Ash Wilson | 61dcb02 | 2014-10-03 08:15:47 -0400 | [diff] [blame] | 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 | } |