Documentation
¶
Index ¶
- type Client
- func (c *Client) Delete(ctx context.Context, path string, headers map[string]string) (*Response, error)
- func (c *Client) Do(ctx context.Context, req Request) (*Response, error)
- func (c *Client) Get(ctx context.Context, path string, query map[string]string, ...) (*Response, error)
- func (c *Client) Post(ctx context.Context, path string, body interface{}, headers map[string]string) (*Response, error)
- func (c *Client) Put(ctx context.Context, path string, body interface{}, headers map[string]string) (*Response, error)
- func (c *Client) SetHeader(key, value string)
- func (c *Client) SetHeaders(headers map[string]string)
- type Request
- type Response
- type TaskAPI
- func (a *TaskAPI) ExecuteTask(ctx context.Context, taskID string) error
- func (a *TaskAPI) GetTaskStatus(ctx context.Context, taskID string) (core.Status, error)
- func (a *TaskAPI) RegisterWithExecutor(exec *executor.TaskExecutor, taskName string, request Request)
- func (a *TaskAPI) Task(request Request) executor.TaskFunc
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client is a client for making API calls
func (*Client) Delete ¶
func (c *Client) Delete(ctx context.Context, path string, headers map[string]string) (*Response, error)
Delete makes a DELETE request
func (*Client) Get ¶
func (c *Client) Get(ctx context.Context, path string, query map[string]string, headers map[string]string) (*Response, error)
Get makes a GET request
func (*Client) Post ¶
func (c *Client) Post(ctx context.Context, path string, body interface{}, headers map[string]string) (*Response, error)
Post makes a POST request
func (*Client) Put ¶
func (c *Client) Put(ctx context.Context, path string, body interface{}, headers map[string]string) (*Response, error)
Put makes a PUT request
func (*Client) SetHeaders ¶
SetHeaders sets multiple headers for all requests
type Request ¶
type Request struct {
Method string
Path string
Body interface{}
Headers map[string]string
Query map[string]string
}
Request represents an API request
type TaskAPI ¶
type TaskAPI struct {
// contains filtered or unexported fields
}
TaskAPI provides a way to execute tasks over an API
func NewTaskAPI ¶
NewTaskAPI creates a new task API with the given client
func (*TaskAPI) ExecuteTask ¶
ExecuteTask executes a task via the API
func (*TaskAPI) GetTaskStatus ¶
GetTaskStatus gets the status of a task
func (*TaskAPI) RegisterWithExecutor ¶
func (a *TaskAPI) RegisterWithExecutor(exec *executor.TaskExecutor, taskName string, request Request)
RegisterWithExecutor registers API tasks with an executor
Click to show internal directories.
Click to hide internal directories.