Ash Wilson | f4d6363 | 2014-10-09 14:54:06 -0400 | [diff] [blame] | 1 | package extensions |
| 2 | |
| 3 | import ( |
| 4 | "github.com/rackspace/gophercloud" |
| 5 | common "github.com/rackspace/gophercloud/openstack/common/extensions" |
Ash Wilson | f4d6363 | 2014-10-09 14:54:06 -0400 | [diff] [blame] | 6 | "github.com/rackspace/gophercloud/pagination" |
| 7 | ) |
| 8 | |
Ash Wilson | f4d6363 | 2014-10-09 14:54:06 -0400 | [diff] [blame] | 9 | // ExtractExtensions accepts a Page struct, specifically an ExtensionPage struct, and extracts the |
| 10 | // elements into a slice of os.Extension structs. |
Ash Wilson | 56d97a6 | 2014-10-13 12:07:47 -0400 | [diff] [blame] | 11 | func ExtractExtensions(page pagination.Page) ([]common.Extension, error) { |
| 12 | return common.ExtractExtensions(page) |
Ash Wilson | f4d6363 | 2014-10-09 14:54:06 -0400 | [diff] [blame] | 13 | } |
| 14 | |
| 15 | // Get retrieves information for a specific extension using its alias. |
Ash Wilson | 56d97a6 | 2014-10-13 12:07:47 -0400 | [diff] [blame] | 16 | func Get(c *gophercloud.ServiceClient, alias string) common.GetResult { |
| 17 | return common.Get(c, alias) |
Ash Wilson | f4d6363 | 2014-10-09 14:54:06 -0400 | [diff] [blame] | 18 | } |
| 19 | |
| 20 | // List returns a Pager which allows you to iterate over the full collection of extensions. |
| 21 | // It does not accept query parameters. |
| 22 | func List(c *gophercloud.ServiceClient) pagination.Pager { |
Ash Wilson | 56d97a6 | 2014-10-13 12:07:47 -0400 | [diff] [blame] | 23 | return common.List(c) |
Ash Wilson | f4d6363 | 2014-10-09 14:54:06 -0400 | [diff] [blame] | 24 | } |