github.com/huaweicloud/golangsdk@v0.0.0-20210831081626-d823fe11ceba/openstack/common/extensions/requests.go (about)

     1  package extensions
     2  
     3  import (
     4  	"github.com/huaweicloud/golangsdk"
     5  	"github.com/huaweicloud/golangsdk/pagination"
     6  )
     7  
     8  // Get retrieves information for a specific extension using its alias.
     9  func Get(c *golangsdk.ServiceClient, alias string) (r GetResult) {
    10  	_, r.Err = c.Get(ExtensionURL(c, alias), &r.Body, nil)
    11  	return
    12  }
    13  
    14  // List returns a Pager which allows you to iterate over the full collection of extensions.
    15  // It does not accept query parameters.
    16  func List(c *golangsdk.ServiceClient) pagination.Pager {
    17  	return pagination.NewPager(c, ListExtensionURL(c), func(r pagination.PageResult) pagination.Page {
    18  		return ExtensionPage{pagination.SinglePageBase(r)}
    19  	})
    20  }