update client to reflect available services
This commit is contained in:
parent
ca83da38ea
commit
bc5582277e
6
godo.go
6
godo.go
|
@ -48,12 +48,15 @@ type Client struct {
|
|||
|
||||
// Services used for communicating with the API
|
||||
Actions ActionsService
|
||||
Domains DomainsService
|
||||
Droplets DropletsService
|
||||
DropletActions DropletActionsService
|
||||
Images ImagesService
|
||||
ImageActions ImageActionsService
|
||||
Keys KeysService
|
||||
Regions RegionsService
|
||||
Sizes SizesService
|
||||
Tags TagsService
|
||||
|
||||
// Optional function called after every successful request made to the DO APIs
|
||||
onRequestCompleted RequestCompletionCallback
|
||||
|
@ -183,12 +186,15 @@ func NewClient(httpClient *http.Client) *Client {
|
|||
|
||||
c := &Client{client: httpClient, BaseURL: baseURL, UserAgent: userAgent}
|
||||
c.Actions = &ActionsServiceOp{client: c}
|
||||
c.Domains = &DomainsServiceOp{client: c}
|
||||
c.Droplets = &DropletsServiceOp{client: c}
|
||||
c.DropletActions = &DropletActionsServiceOp{client: c}
|
||||
c.Images = &ImagesServiceOp{client: c}
|
||||
c.ImageActions = &ImageActionsServiceOp{client: c}
|
||||
c.Keys = &KeysServiceOp{client: c}
|
||||
c.Regions = &RegionsServiceOp{client: c}
|
||||
c.Sizes = &SizesServiceOp{client: c}
|
||||
c.Tags = &TagsServiceOp{client: c}
|
||||
|
||||
c.headers = make(map[string]string)
|
||||
|
||||
|
|
10
godo_test.go
10
godo_test.go
|
@ -73,25 +73,15 @@ func testURLParseError(t *testing.T, err error) {
|
|||
|
||||
func testClientServices(t *testing.T, c *Client) {
|
||||
services := []string{
|
||||
"Account",
|
||||
"Actions",
|
||||
"Balance",
|
||||
"BillingHistory",
|
||||
"CDNs",
|
||||
"Domains",
|
||||
"Droplets",
|
||||
"DropletActions",
|
||||
"Images",
|
||||
"ImageActions",
|
||||
"Invoices",
|
||||
"Keys",
|
||||
"Monitoring",
|
||||
"Regions",
|
||||
"Sizes",
|
||||
"FloatingIPs",
|
||||
"FloatingIPActions",
|
||||
"ReservedIPs",
|
||||
"ReservedIPActions",
|
||||
"Tags",
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue