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. |
Jon Perritt | 3860b51 | 2016-03-29 12:01:48 -0500 | [diff] [blame] | 9 | func Get(c *gophercloud.ServiceClient, alias string) (r GetResult) { |
Jon Perritt | db0ae14 | 2016-03-13 00:33:41 -0600 | [diff] [blame] | 10 | _, r.Err = c.Get(ExtensionURL(c, alias), &r.Body, nil) |
jrperritt | 29ae6b3 | 2016-04-13 12:59:37 -0500 | [diff] [blame] | 11 | return |
Ash Wilson | 61dcb02 | 2014-10-03 08:15:47 -0400 | [diff] [blame] | 12 | } |
| 13 | |
Ash Wilson | 8e1fc8d | 2014-10-03 08:35:33 -0400 | [diff] [blame] | 14 | // List returns a Pager which allows you to iterate over the full collection of extensions. |
| 15 | // It does not accept query parameters. |
Ash Wilson | 61dcb02 | 2014-10-03 08:15:47 -0400 | [diff] [blame] | 16 | func List(c *gophercloud.ServiceClient) pagination.Pager { |
Ash Wilson | b8b16f8 | 2014-10-20 10:19:49 -0400 | [diff] [blame] | 17 | return pagination.NewPager(c, ListExtensionURL(c), func(r pagination.PageResult) pagination.Page { |
Ash Wilson | 61dcb02 | 2014-10-03 08:15:47 -0400 | [diff] [blame] | 18 | return ExtensionPage{pagination.SinglePageBase(r)} |
| 19 | }) |
| 20 | } |