client

package
v0.0.0-...-5db00e0 Latest Latest
Warning

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

Go to latest
Published: Nov 16, 2017 License: MIT Imports: 12 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 {
	Marshaler *jsonpb.Marshaler
	Password  string
	// contains filtered or unexported fields
}

Client represents the HTTP Task client.

func NewClient

func NewClient(address string) *Client

NewClient returns a new HTTP client for accessing Create/List/Get/Cancel Task endpoints. "address" is the address of the TES server.

func (*Client) CancelTask

func (c *Client) CancelTask(ctx context.Context, req *tes.CancelTaskRequest) (*tes.CancelTaskResponse, error)

CancelTask POSTs to /v1/tasks/{id}:cancel

func (*Client) CreateTask

func (c *Client) CreateTask(ctx context.Context, task *tes.Task) (*tes.CreateTaskResponse, error)

CreateTask POSTs a Task message to /v1/tasks

func (*Client) GetServiceInfo

func (c *Client) GetServiceInfo(ctx context.Context, req *tes.ServiceInfoRequest) (*tes.ServiceInfo, error)

GetServiceInfo returns result of GET /v1/tasks/service-info

func (*Client) GetTask

func (c *Client) GetTask(ctx context.Context, req *tes.GetTaskRequest) (*tes.Task, error)

GetTask returns the raw bytes from GET /v1/tasks/{id}

func (*Client) ListTasks

func (c *Client) ListTasks(ctx context.Context, req *tes.ListTasksRequest) (*tes.ListTasksResponse, error)

ListTasks returns the result of GET /v1/tasks

func (*Client) WaitForTask

func (c *Client) WaitForTask(ctx context.Context, taskIDs ...string) error

WaitForTask polls /v1/tasks/{id} for each Id provided and returns once all tasks are in a terminal state.

Jump to

Keyboard shortcuts

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