client

package
v0.0.54 Latest Latest
Warning

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

Go to latest
Published: May 6, 2022 License: Apache-2.0, MIT Imports: 11 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) CARExport added in v0.0.5

func (c *Client) CARExport(ctx context.Context) (*car.CarReader, func() error, error)

func (*Client) Close

func (c *Client) Close() error

Close the transport used by the client

func (*Client) Complete added in v0.0.5

func (c *Client) Complete(ctx context.Context, worker string) error

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) DeleteTask added in v0.0.21

func (c *Client) DeleteTask(ctx context.Context, uuid string) error

func (*Client) Drain added in v0.0.5

func (c *Client) Drain(ctx context.Context, worker string) 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 tasks.PopTask) (tasks.Task, error)

PopTask requests a Task from the controller.

The PopTask request specifies the initial status to set the task to, the identity of client requesting and assigned the task, and any tagged tasks that are begin requested.

If the request specifies no tags, then this selects any task. If the request specifies tags, then this selects any task with a tag matching one of the tags in the request, or any untagged task.

func (*Client) ResetWorker added in v0.0.14

func (c *Client) ResetWorker(ctx context.Context, worker string) error

func (*Client) UpdateTask

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

type ErrRequestFailed

type ErrRequestFailed struct {
	Code int
}

func (ErrRequestFailed) Error

func (e ErrRequestFailed) Error() string

Jump to

Keyboard shortcuts

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