Documentation ¶
Index ¶
- Constants
- type APIError
- type AuthAPIClient
- type NerdAPIClient
- func (nerdapi *NerdAPIClient) CreateDataset() (d *payload.DatasetCreateOutput, err error)
- func (nerdapi *NerdAPIClient) CreateSession() (sess *payload.SessionCreateOutput, err error)
- func (nerdapi *NerdAPIClient) CreateTask(image string, dataset string, env map[string]string) (output *payload.TaskCreateOutput, err error)
- func (nerdapi *NerdAPIClient) CreateWorker() (worker *payload.WorkerCreateOutput, err error)
- func (nerdapi *NerdAPIClient) DeleteWorker(workerID string) (err error)
- func (nerdapi *NerdAPIClient) GetDataset(id string) (d *payload.DatasetDescribeOutput, err error)
- func (nerdapi *NerdAPIClient) ListTasks() (tl *payload.TaskListOutput, err error)
- func (nerdapi *NerdAPIClient) PatchTaskStatus(id string, ts *payload.TaskCreateInput) error
- type NerdAPIConfig
Constants ¶
const (
//AuthHeader is the name of the HTTP Authorization header.
AuthHeader = "Authorization"
)
const (
//TokenEndpoint is the endpoint from where to fetch the JWT.
TokenEndpoint = "token/?service=nce.nerdalize.com"
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AuthAPIClient ¶
type AuthAPIClient struct {
URL string
}
AuthAPIClient is the client for the nerdalize authentication server.
func NewAuthAPI ¶
func NewAuthAPI(url string) *AuthAPIClient
NewAuthAPI creates a new AuthAPIClient.
type NerdAPIClient ¶
type NerdAPIClient struct {
NerdAPIConfig
}
NerdAPIClient is a client for the Nerdalize API.
func NewNerdAPI ¶
func NewNerdAPI(conf NerdAPIConfig) (*NerdAPIClient, error)
NewNerdAPI creates a new NerdAPIClient from a config object. When no URL is set it tries to get the URL from the audience field in the JWT.
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 }
NerdAPIConfig provides config details to create a NerdAPIClient.