resto

package
v0.22.0 Latest Latest
Warning

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

Go to latest
Published: Dec 22, 2020 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const ConsoleLogAsset = "console.log"

ConsoleLogAsset represents job asset log file name.

Variables

View Source
var (
	// ErrServerError is returned when the server was not able to correctly handle our request (status code >= 500).
	ErrServerError = errors.New("internal server error")
	// ErrJobNotFound is returned when the requested job was not found.
	ErrJobNotFound = errors.New("job was not found")
)

Functions

This section is empty.

Types

type Client

type Client struct {
	HTTPClient *http.Client
	URL        string
	Username   string
	AccessKey  string
}

Client http client.

func New

func New(url, username, accessKey string, timeout time.Duration) Client

New creates a new client.

func (*Client) GetJobAssetFileContent added in v0.22.0

func (c *Client) GetJobAssetFileContent(ctx context.Context, jobID, fileName string) ([]byte, error)

GetJobAssetFileContent returns the job asset file content.

func (*Client) PollJob added in v0.21.1

func (c *Client) PollJob(ctx context.Context, id string, interval time.Duration) (job.Job, error)

PollJob polls job details at an interval, until the job has ended, whether successfully or due to an error.

func (*Client) ReadJob added in v0.21.1

func (c *Client) ReadJob(ctx context.Context, id string) (job.Job, error)

ReadJob returns the job details.

Jump to

Keyboard shortcuts

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