Versions in this module Expand all Collapse all v1 v1.12.0 Jul 26, 2016 Changes in this version + var ErrClosed = errors.New("agent: closed") + func DeleteTask(tx *bolt.Tx, id string) error + func GetTask(tx *bolt.Tx, id string) (*api.Task, error) + func GetTaskStatus(tx *bolt.Tx, id string) (*api.TaskStatus, error) + func InitDB(db *bolt.DB) error + func PutTask(tx *bolt.Tx, task *api.Task) error + func PutTaskStatus(tx *bolt.Tx, id string, status *api.TaskStatus) error + func SetTaskAssignment(tx *bolt.Tx, id string, assigned bool) error + func TaskAssigned(tx *bolt.Tx, id string) bool + func WalkTaskStatus(tx *bolt.Tx, fn func(id string, status *api.TaskStatus) error) error + func WalkTasks(tx *bolt.Tx, fn func(task *api.Task) error) error + type Agent struct + func New(config *Config) (*Agent, error) + func (a *Agent) Err(ctx context.Context) error + func (a *Agent) Ready() <-chan struct{} + func (a *Agent) Start(ctx context.Context) error + func (a *Agent) Stop(ctx context.Context) error + func (a *Agent) UpdateTaskStatus(ctx context.Context, taskID string, status *api.TaskStatus) error + type Config struct + Conn *grpc.ClientConn + DB *bolt.DB + Executor exec.Executor + Hostname string + Managers picker.Remotes + NotifyRoleChange chan<- api.NodeRole + Picker *picker.Picker + type Node struct + func NewNode(c *NodeConfig) (*Node, error) + func (n *Node) Agent() *Agent + func (n *Node) CertificateRequested() <-chan struct{} + func (n *Node) Err(ctx context.Context) error + func (n *Node) ListenControlSocket(ctx context.Context) <-chan *grpc.ClientConn + func (n *Node) Manager() *manager.Manager + func (n *Node) NodeID() string + func (n *Node) NodeMembership() api.NodeSpec_Membership + func (n *Node) Ready() <-chan struct{} + func (n *Node) Remotes() []api.Peer + func (n *Node) Start(ctx context.Context) error + func (n *Node) Stop(ctx context.Context) error + type NodeConfig struct + AdvertiseRemoteAPI string + ElectionTick uint32 + Executor exec.Executor + ExternalCAs []*api.ExternalCA + ForceNewCluster bool + HeartbeatTick uint32 + Hostname string + JoinAddr string + JoinToken string + ListenControlAPI string + ListenRemoteAPI string + StateDir string + type StatusReporter interface + UpdateTaskStatus func(ctx context.Context, taskID string, status *api.TaskStatus) error + type Worker interface + Assign func(ctx context.Context, tasks []*api.Task) error + Init func(ctx context.Context) error + Listen func(ctx context.Context, reporter StatusReporter)