client

package
v0.0.0-...-eee359e Latest Latest
Warning

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

Go to latest
Published: Apr 8, 2017 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Alloc

type Alloc struct {
	PoolID   string `json:"pool_id"`
	AllocID  string `json:"alloc_id"`
	WorkerID string `json:"worker_id"`
}

Alloc payload is returned to indicate an allocation

type Client

type Client struct {
	// contains filtered or unexported fields
}

Client facilitates communication with the line server

func NewClient

func NewClient(endpoint string, aws *session.Session) (c *Client, err error)

NewClient sets up an HTTP client that communicates with the server

func (*Client) CompleteAlloc

func (c *Client) CompleteAlloc(in *CompleteAllocInput) (out *CompleteAllocOutput, err error)

CompleteAlloc indicates to the server that an allocation has ended

func (*Client) CreatePool

func (c *Client) CreatePool(in *CreatePoolInput) (out *CreatePoolOutput, err error)

CreatePool sets up a new capacity pool

func (*Client) DisbandPool

func (c *Client) DisbandPool(in *DisbandPoolInput) (out *DisbandPoolOutput, err error)

DisbandPool will remove a pool

func (*Client) ReceiveAllocs

func (c *Client) ReceiveAllocs(in *ReceiveAllocsInput) (out *ReceiveAllocsOutput, err error)

ReceiveAllocs will open a long poll for new allocations

func (*Client) RegisterWorker

func (c *Client) RegisterWorker(in *RegisterWorkerInput) (out *RegisterWorkerOutput, err error)

RegisterWorker will setup a worker that provides capacity to a pool

func (*Client) ScheduleEval

func (c *Client) ScheduleEval(in *ScheduleEvalInput) (out *ScheduleEvalOutput, err error)

ScheduleEval will queue up an evaluation to be processed by the scheduling logic

func (*Client) SendHeartbeat

func (c *Client) SendHeartbeat(in *SendHeartbeatInput) (out *SendHeartbeatOutput, err error)

SendHeartbeat will submit a periodic report that updates ttls of various entities under the workers responsibility

type CompleteAllocInput

type CompleteAllocInput struct {
	PoolID  string `json:"pool_id"`
	AllocID string `json:"alloc_id"`
}

CompleteAllocInput is provided to complete an allocation

type CompleteAllocOutput

type CompleteAllocOutput struct{}

CompleteAllocOutput is returned when a worker is removed

type CreatePoolInput

type CreatePoolInput struct{}

CreatePoolInput is input to the pool creation call

type CreatePoolOutput

type CreatePoolOutput struct {
	PoolID string `json:"pool_id"`
}

CreatePoolOutput is output of the pool creation call

type DisbandPoolInput

type DisbandPoolInput struct {
	PoolID string `json:"pool_id"`
}

DisbandPoolInput will remove a worker

type DisbandPoolOutput

type DisbandPoolOutput struct{}

DisbandPoolOutput is returned when a worker is removed

type ReceiveAllocsInput

type ReceiveAllocsInput struct {
	WorkerQueueURL      string `json:"worker_queue_url"`
	MaxNumberOfMessages int64  `json:"max_number_of_messages"`
	WaitTimeSeconds     int64  `json:"wait_time_seconds"`
}

ReceiveAllocsInput will block until allocations are available for the worker

type ReceiveAllocsOutput

type ReceiveAllocsOutput struct {
	Allocs []*Alloc `json:"allocs"`
}

ReceiveAllocsOutput is returned when new allocs are available

type RegisterWorkerInput

type RegisterWorkerInput struct {
	PoolID   string `json:"pool_id"`
	Capacity int    `json:"capacity"`
}

RegisterWorkerInput will off the pool capacity to work with

type RegisterWorkerOutput

type RegisterWorkerOutput struct {
	PoolID   string `json:"pool_id"`
	WorkerID string `json:"worker_id"`
	QueueURL string `json:"queue_url"`
	Capacity int    `json:"capacity"`
}

RegisterWorkerOutput is returned when a worker is added to a pool

type ScheduleEvalInput

type ScheduleEvalInput struct {
	PoolID    string `json:"pool_id"`
	DatasetID string `json:"dataset_id"`
	Size      int    `json:"size"`
}

ScheduleEvalInput will block until allocations are available for the worker

type ScheduleEvalOutput

type ScheduleEvalOutput struct{}

ScheduleEvalOutput is returned when new allocs are available

type SendHeartbeatInput

type SendHeartbeatInput struct {
	PoolID   string   `json:"pool_id"`
	WorkerID string   `json:"worker_id"`
	Allocs   []string `json:"allocs"`
	Datasets []string `json:"datasets"`
}

SendHeartbeatInput is send when updating heartbeats

type SendHeartbeatOutput

type SendHeartbeatOutput struct {
}

SendHeartbeatOutput is returned when updating heartbeats

Jump to

Keyboard shortcuts

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