client

package
v0.0.4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 26, 2021 License: Apache-2.0, MIT Imports: 10 Imported by: 0

Documentation

Index

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 the API client that performs all operations against the dealbot controller.

func New

func New(ctx *cli.Context) *Client

New initializes a new API client

func NewFromEndpoint

func NewFromEndpoint(endpoint string) *Client

NewFromEndpoint returns an API client at the given endpoint

func (*Client) Close

func (c *Client) Close() error

Close the transport used by the client

func (*Client) CreateRetrievalTask

func (c *Client) CreateRetrievalTask(ctx context.Context, retrievalTask *tasks.RetrievalTask) (*tasks.Task, error)

func (*Client) CreateStorageTask

func (c *Client) CreateStorageTask(ctx context.Context, storageTask *tasks.StorageTask) (*tasks.Task, error)

func (*Client) GetTask

func (c *Client) GetTask(ctx context.Context, uuid string) (*tasks.Task, error)

func (*Client) ListTasks

func (c *Client) ListTasks(ctx context.Context) ([]*tasks.Task, error)

func (*Client) PopTask

func (c *Client) PopTask(ctx context.Context, r *UpdateTaskRequest) (*tasks.Task, error)

func (*Client) UpdateTask

func (c *Client) UpdateTask(ctx context.Context, uuid string, r *UpdateTaskRequest) (*tasks.Task, error)

type ErrRequestFailed

type ErrRequestFailed struct {
	Code int
}

func (ErrRequestFailed) Error

func (e ErrRequestFailed) Error() string

type UpdateTaskRequest

type UpdateTaskRequest struct {
	Status   tasks.Status `json:"status"`
	WorkedBy string       `json:"worked_by,omitempty"` // which dealbot works on that task
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL