Versions in this module Expand all Collapse all v0 v0.2.0 Nov 19, 2015 Changes in this version + const TaskDriverFailure + const TaskKilled + const TaskStarted + const TaskTerminated + type AgentMembersNameSort []*AgentMember + func (a AgentMembersNameSort) Len() int + func (a AgentMembersNameSort) Less(i, j int) bool + func (a AgentMembersNameSort) Swap(i, j int) type Allocation + TaskStates map[string]*TaskState type AllocationListStub + TaskStates map[string]*TaskState + type AllocationSort []*Allocation + func (a AllocationSort) Len() int + func (a AllocationSort) Less(i, j int) bool + func (a AllocationSort) Swap(i, j int) type Constraint + func NewConstraint(left, operand, right string) *Constraint type Job + Update *UpdateStrategy + type Port struct + Label string + Value int + type RestartPolicy struct + Attempts int + Delay time.Duration + Interval time.Duration + func NewRestartPolicy() *RestartPolicy + type Service struct + Checks []ServiceCheck + Id string + Name string + PortLabel string + Tags []string + type ServiceCheck struct + Id string + Interval time.Duration + Name string + Path string + Protocol string + Script string + Timeout time.Duration + Type string type Task + Services []Service + type TaskEvent struct + DriverError string + ExitCode int + KillError string + Message string + Signal int + Time int64 + Type string type TaskGroup + RestartPolicy *RestartPolicy + type TaskState struct + Events []*TaskEvent + State string + type UpdateStrategy struct + MaxParallel int + Stagger time.Duration v0.1.2 Oct 6, 2015 v0.1.1 Oct 5, 2015 Changes in this version type Task + Env map[string]string v0.1.0 Sep 28, 2015 Changes in this version + const JobTypeBatch + const JobTypeService + type Agent struct + func (a *Agent) Datacenter() (string, error) + func (a *Agent) ForceLeave(node string) error + func (a *Agent) Join(addrs ...string) (int, error) + func (a *Agent) Members() ([]*AgentMember, error) + func (a *Agent) NodeName() (string, error) + func (a *Agent) Region() (string, error) + func (a *Agent) Self() (map[string]map[string]interface{}, error) + func (a *Agent) Servers() ([]string, error) + func (a *Agent) SetServers(addrs []string) error + type AgentMember struct + Addr string + DelegateCur uint8 + DelegateMax uint8 + DelegateMin uint8 + Name string + Port uint16 + ProtocolCur uint8 + ProtocolMax uint8 + ProtocolMin uint8 + Status string + Tags map[string]string + type AllocIndexSort []*AllocationListStub + func (a AllocIndexSort) Len() int + func (a AllocIndexSort) Less(i, j int) bool + func (a AllocIndexSort) Swap(i, j int) + type Allocation struct + ClientDescription string + ClientStatus string + CreateIndex uint64 + DesiredDescription string + DesiredStatus string + EvalID string + ID string + Job *Job + JobID string + Metrics *AllocationMetric + ModifyIndex uint64 + Name string + NodeID string + Resources *Resources + TaskGroup string + TaskResources map[string]*Resources + type AllocationListStub struct + ClientDescription string + ClientStatus string + CreateIndex uint64 + DesiredDescription string + DesiredStatus string + EvalID string + ID string + JobID string + ModifyIndex uint64 + Name string + NodeID string + TaskGroup string + type AllocationMetric struct + AllocationTime time.Duration + ClassExhausted map[string]int + ClassFiltered map[string]int + CoalescedFailures int + ConstraintFiltered map[string]int + DimensionExhausted map[string]int + NodesEvaluated int + NodesExhausted int + NodesFiltered int + Scores map[string]float64 + type Allocations struct + func (a *Allocations) Info(allocID string, q *QueryOptions) (*Allocation, *QueryMeta, error) + func (a *Allocations) List(q *QueryOptions) ([]*AllocationListStub, *QueryMeta, error) + type Client struct + func NewClient(config *Config) (*Client, error) + func (c *Client) Agent() *Agent + func (c *Client) Allocations() *Allocations + func (c *Client) Evaluations() *Evaluations + func (c *Client) Jobs() *Jobs + func (c *Client) Nodes() *Nodes + func (c *Client) Raw() *Raw + func (c *Client) Status() *Status + type Config struct + Address string + HttpClient *http.Client + Region string + WaitTime time.Duration + func DefaultConfig() *Config + type Constraint struct + Hard bool + LTarget string + Operand string + RTarget string + Weight int + func HardConstraint(left, operand, right string) *Constraint + func SoftConstraint(left, operand, right string, weight int) *Constraint + type EvalIndexSort []*Evaluation + func (e EvalIndexSort) Len() int + func (e EvalIndexSort) Less(i, j int) bool + func (e EvalIndexSort) Swap(i, j int) + type Evaluation struct + CreateIndex uint64 + ID string + JobID string + JobModifyIndex uint64 + ModifyIndex uint64 + NextEval string + NodeID string + NodeModifyIndex uint64 + PreviousEval string + Priority int + Status string + StatusDescription string + TriggeredBy string + Type string + Wait time.Duration + type Evaluations struct + func (e *Evaluations) Allocations(evalID string, q *QueryOptions) ([]*AllocationListStub, *QueryMeta, error) + func (e *Evaluations) Info(evalID string, q *QueryOptions) (*Evaluation, *QueryMeta, error) + func (e *Evaluations) List(q *QueryOptions) ([]*Evaluation, *QueryMeta, error) + type Job struct + AllAtOnce bool + Constraints []*Constraint + CreateIndex uint64 + Datacenters []string + ID string + Meta map[string]string + ModifyIndex uint64 + Name string + Priority int + Region string + Status string + StatusDescription string + TaskGroups []*TaskGroup + Type string + func NewBatchJob(id, name, region string, pri int) *Job + func NewServiceJob(id, name, region string, pri int) *Job + func (j *Job) AddDatacenter(dc string) *Job + func (j *Job) AddTaskGroup(grp *TaskGroup) *Job + func (j *Job) Constrain(c *Constraint) *Job + func (j *Job) SetMeta(key, val string) *Job + type JobIDSort []*JobListStub + func (j JobIDSort) Len() int + func (j JobIDSort) Less(a, b int) bool + func (j JobIDSort) Swap(a, b int) + type JobListStub struct + CreateIndex uint64 + ID string + ModifyIndex uint64 + Name string + Priority int + Status string + StatusDescription string + Type string + type Jobs struct + func (j *Jobs) Allocations(jobID string, q *QueryOptions) ([]*AllocationListStub, *QueryMeta, error) + func (j *Jobs) Deregister(jobID string, q *WriteOptions) (string, *WriteMeta, error) + func (j *Jobs) Evaluations(jobID string, q *QueryOptions) ([]*Evaluation, *QueryMeta, error) + func (j *Jobs) ForceEvaluate(jobID string, q *WriteOptions) (string, *WriteMeta, error) + func (j *Jobs) Info(jobID string, q *QueryOptions) (*Job, *QueryMeta, error) + func (j *Jobs) List(q *QueryOptions) ([]*JobListStub, *QueryMeta, error) + func (j *Jobs) Register(job *Job, q *WriteOptions) (string, *WriteMeta, error) + type NetworkResource struct + CIDR string + DynamicPorts []string + MBits int + Public bool + ReservedPorts []int + type Node struct + Attributes map[string]string + CreateIndex uint64 + Datacenter string + Drain bool + ID string + Links map[string]string + ModifyIndex uint64 + Name string + NodeClass string + Reserved *Resources + Resources *Resources + Status string + StatusDescription string + type NodeIndexSort []*NodeListStub + func (n NodeIndexSort) Len() int + func (n NodeIndexSort) Less(i, j int) bool + func (n NodeIndexSort) Swap(i, j int) + type NodeListStub struct + CreateIndex uint64 + Datacenter string + Drain bool + ID string + ModifyIndex uint64 + Name string + NodeClass string + Status string + StatusDescription string + type Nodes struct + func (n *Nodes) Allocations(nodeID string, q *QueryOptions) ([]*AllocationListStub, *QueryMeta, error) + func (n *Nodes) ForceEvaluate(nodeID string, q *WriteOptions) (string, *WriteMeta, error) + func (n *Nodes) Info(nodeID string, q *QueryOptions) (*Node, *QueryMeta, error) + func (n *Nodes) List(q *QueryOptions) ([]*NodeListStub, *QueryMeta, error) + func (n *Nodes) ToggleDrain(nodeID string, drain bool, q *WriteOptions) (*WriteMeta, error) + type QueryMeta struct + KnownLeader bool + LastContact time.Duration + LastIndex uint64 + RequestTime time.Duration + type QueryOptions struct + AllowStale bool + Region string + WaitIndex uint64 + WaitTime time.Duration + type Raw struct + func (raw *Raw) Delete(endpoint string, out interface{}, q *WriteOptions) (*WriteMeta, error) + func (raw *Raw) Query(endpoint string, out interface{}, q *QueryOptions) (*QueryMeta, error) + func (raw *Raw) Write(endpoint string, in, out interface{}, q *WriteOptions) (*WriteMeta, error) + type Resources struct + CPU int + DiskMB int + IOPS int + MemoryMB int + Networks []*NetworkResource + type Status struct + func (s *Status) Leader() (string, error) + func (s *Status) Peers() ([]string, error) + type Task struct + Config map[string]string + Constraints []*Constraint + Driver string + Meta map[string]string + Name string + Resources *Resources + func NewTask(name, driver string) *Task + func (t *Task) Constrain(c *Constraint) *Task + func (t *Task) Require(r *Resources) *Task + func (t *Task) SetConfig(key, val string) *Task + func (t *Task) SetMeta(key, val string) *Task + type TaskGroup struct + Constraints []*Constraint + Count int + Meta map[string]string + Name string + Tasks []*Task + func NewTaskGroup(name string, count int) *TaskGroup + func (g *TaskGroup) AddTask(t *Task) *TaskGroup + func (g *TaskGroup) Constrain(c *Constraint) *TaskGroup + func (g *TaskGroup) SetMeta(key, val string) *TaskGroup + type WriteMeta struct + LastIndex uint64 + RequestTime time.Duration + type WriteOptions struct + Region string