client

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Mar 9, 2017 License: Apache-2.0 Imports: 6 Imported by: 2 modules, 3 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const (
	AuthHeader = "Authorization"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type APIError

type APIError struct {
	Request  *http.Request
	Response *http.Response
	Err      error
}

APIError is the error that is returned by client.NerdAPIClient

func (APIError) Cause

func (e APIError) Cause() error

func (APIError) Error

func (e APIError) Error() string

type AuthAPIClient

type AuthAPIClient struct {
	URL string
}

func NewAuthAPI

func NewAuthAPI(url string) *AuthAPIClient

func (*AuthAPIClient) GetToken

func (auth *AuthAPIClient) GetToken(user, pass string) (string, error)

GetToken gets a JWT for a given user.

type NerdAPIClient

type NerdAPIClient struct {
	NerdAPIConfig
}

NerdAPIClient is a client for the Nerdalize API.

func NewNerdAPI

func NewNerdAPI(conf NerdAPIConfig) (*NerdAPIClient, error)

func (*NerdAPIClient) CreateDataset

func (nerdapi *NerdAPIClient) CreateDataset() (d *payload.DatasetCreateOutput, err error)

CreateDataset creates a new dataset.

func (*NerdAPIClient) CreateSession

func (nerdapi *NerdAPIClient) CreateSession() (sess *payload.SessionCreateOutput, err error)

CreateSession creates a new user session.

func (*NerdAPIClient) CreateTask

func (nerdapi *NerdAPIClient) CreateTask(image string, dataset string, env map[string]string) (output *payload.TaskCreateOutput, err error)

CreateTask creates a new executable task.

func (*NerdAPIClient) CreateWorker

func (nerdapi *NerdAPIClient) CreateWorker() (worker *payload.WorkerCreateOutput, err error)

CreateWorker creates registers this client as workable capacity

func (*NerdAPIClient) DeleteWorker

func (nerdapi *NerdAPIClient) DeleteWorker(workerID string) (err error)

DeleteWorker removes a worker

func (*NerdAPIClient) GetDataset

func (nerdapi *NerdAPIClient) GetDataset(id string) (d *payload.DatasetDescribeOutput, err error)

GetDataset gets a dataset by ID.

func (*NerdAPIClient) ListTasks

func (nerdapi *NerdAPIClient) ListTasks() (tl *payload.TaskListOutput, err error)

ListTasks lists all tasks.

func (*NerdAPIClient) PatchTaskStatus

func (nerdapi *NerdAPIClient) PatchTaskStatus(id string, ts *payload.TaskCreateInput) error

PatchTaskStatus updates the status of a task.

type NerdAPIConfig

type NerdAPIConfig struct {
	Credentials *credentials.NerdAPI
	URL         string
	ProjectID   string
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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