github.com/vnpaycloud-console/gophercloud/v2@v2.0.5/openstack/sharedfilesystems/apiversions/requests.go (about) 1 package apiversions 2 3 import ( 4 "context" 5 6 "github.com/vnpaycloud-console/gophercloud/v2" 7 "github.com/vnpaycloud-console/gophercloud/v2/pagination" 8 ) 9 10 // List lists all the API versions available to end-users. 11 func List(c *gophercloud.ServiceClient) pagination.Pager { 12 return pagination.NewPager(c, listURL(c), func(r pagination.PageResult) pagination.Page { 13 return APIVersionPage{pagination.SinglePageBase(r)} 14 }) 15 } 16 17 // Get will get a specific API version, specified by major ID. 18 func Get(ctx context.Context, client *gophercloud.ServiceClient, v string) (r GetResult) { 19 resp, err := client.Get(ctx, getURL(client, v), &r.Body, nil) 20 _, r.Header, r.Err = gophercloud.ParseResponse(resp, err) 21 return 22 }