Documentation ¶
Index ¶
- func ToString(o interface{}) string
- type Api
- type Error
- type HTTPError
- type HttpClient
- func (c *HttpClient) Delete(ctx context.Context, name, path string, responseBody interface{}) error
- func (c *HttpClient) DeleteWithQuery(ctx context.Context, name, path string, requestBody interface{}, ...) error
- func (c *HttpClient) Get(ctx context.Context, name, path string, responseBody interface{}) error
- func (c *HttpClient) GetWithQuery(ctx context.Context, name, path string, query url.Values, ...) error
- func (c *HttpClient) Post(ctx context.Context, name, path string, requestBody interface{}, ...) error
- func (c *HttpClient) Put(ctx context.Context, name, path string, requestBody interface{}, ...) error
- type Log
- type Task
- type TaskResponse
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Api ¶ added in v0.4.0
type Api interface { // WaitForResourceId will poll the Task, waiting for the Task to finish processing, where it will then return. // An error will be returned if the Task couldn't be retrieved or the Task was not processed successfully. // // The Task will be continuously polled until the Task either fails or succeeds - cancellation can be achieved // by cancelling the context. WaitForResourceId(ctx context.Context, id string) (int, error) // Wait will poll the Task, waiting for the Task to finish processing, where it will then return. // An error will be returned if the Task couldn't be retrieved or the Task was not processed successfully. // // The Task will be continuously polled until the Task either fails or succeeds - cancellation can be achieved // by cancelling the context. Wait(ctx context.Context, id string) error // WaitForResource will poll the Task, waiting for the Task to finish processing, where it will then marshal the // returned resource into the value pointed to be `resource`. // // The Task will be continuously polled until the Task either fails or succeeds - cancellation can be achieved // by cancelling the context. WaitForResource(ctx context.Context, id string, resource interface{}) error // WaitForTask will poll the Task, waiting for it to enter a terminal state (i.e Done or Error). This Task // will then be returned, or an error in case it cannot be retrieved. WaitForTask(ctx context.Context, id string) (*Task, error) }
func NewAPI ¶
func NewAPI(client *HttpClient, logger Log) Api
type Error ¶
type Error struct { Type *string `json:"type,omitempty"` Description *string `json:"description,omitempty"` Status *string `json:"status,omitempty"` }
func (*Error) StatusCode ¶
type HttpClient ¶
type HttpClient struct {
// contains filtered or unexported fields
}
func NewHttpClient ¶
func NewHttpClient(client *http.Client, baseUrl string) (*HttpClient, error)
func (*HttpClient) Delete ¶
func (c *HttpClient) Delete(ctx context.Context, name, path string, responseBody interface{}) error
func (*HttpClient) DeleteWithQuery ¶ added in v0.1.11
func (c *HttpClient) DeleteWithQuery(ctx context.Context, name, path string, requestBody interface{}, responseBody interface{}) error
func (*HttpClient) Get ¶
func (c *HttpClient) Get(ctx context.Context, name, path string, responseBody interface{}) error
func (*HttpClient) GetWithQuery ¶
type Task ¶ added in v0.9.0
type TaskResponse ¶ added in v0.5.0
type TaskResponse struct {
ID *string `json:"taskId,omitempty"`
}
TaskResponse is the high-level response when a Create/Update/Delete operation is in progress.
func (TaskResponse) String ¶ added in v0.5.0
func (o TaskResponse) String() string
Click to show internal directories.
Click to hide internal directories.