Documentation ¶
Overview ¶
Package coordinator implements a benchmark task manager and API.
Index ¶
- type Client
- func (c *Client) Fail(ctx context.Context, id uuid.UUID) error
- func (c *Client) Halt(ctx context.Context, id uuid.UUID) error
- func (c *Client) Jobs(ctx context.Context) (*JobsResponse, error)
- func (c *Client) Start(ctx context.Context, id uuid.UUID) error
- func (c *Client) UploadResult(ctx context.Context, id uuid.UUID, r io.Reader) error
- type Coordinator
- type Handlers
- type Job
- type JobsRequest
- type JobsResponse
- type ResultRequest
- type StatusChangeRequest
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Coordinator ¶
type Coordinator struct {
// contains filtered or unexported fields
}
func (*Coordinator) Jobs ¶
func (c *Coordinator) Jobs(ctx context.Context, req *JobsRequest) (*JobsResponse, error)
Jobs requests next jobs for a worker.
func (*Coordinator) Result ¶
func (c *Coordinator) Result(ctx context.Context, req *ResultRequest) error
Result processes a datafile upload.
func (*Coordinator) SetLogger ¶
func (c *Coordinator) SetLogger(l *zap.Logger)
SetLogger sets the logger used by the Coordinator.
func (*Coordinator) StatusChange ¶
func (c *Coordinator) StatusChange(ctx context.Context, req *StatusChangeRequest) error
StatusChange records a job status change.
type Handlers ¶
type Handlers struct {
// contains filtered or unexported fields
}
func NewHandlers ¶
func NewHandlers(c *Coordinator, l *zap.Logger) *Handlers
type JobsRequest ¶
type JobsRequest struct {
Worker string
}
func (*JobsRequest) Validate ¶
func (r *JobsRequest) Validate() error
type JobsResponse ¶
type JobsResponse struct {
Jobs []*Job `json:"jobs"`
}
func NoJobsAvailable ¶
func NoJobsAvailable() *JobsResponse
type ResultRequest ¶
func (*ResultRequest) Validate ¶
func (r *ResultRequest) Validate() error
type StatusChangeRequest ¶
type StatusChangeRequest struct { Worker string UUID uuid.UUID From []entity.TaskStatus To entity.TaskStatus }
func (*StatusChangeRequest) Validate ¶
func (r *StatusChangeRequest) Validate() error
Click to show internal directories.
Click to hide internal directories.