Documentation ¶
Index ¶
Constants ¶
View Source
const ( AgentStateStopped = "stopped" AgentStateRunning = "running" AgentStateCrashed = "crashed" AgentStateKilled = "killed" )
View Source
const ( TokenFile = ".meeko_token" TokenLen = 32 )
View Source
const TerminationTimeout = 5 * time.Second
Variables ¶
Functions ¶
func ReadOrGenerateToken ¶
Types ¶
type ActionContext ¶
type ActionContext interface { SignalProgress() error Stdout() io.Writer Stderr() io.Writer Interrupted() <-chan struct{} }
func NewNilActionContext ¶
func NewNilActionContext() ActionContext
type AgentStateChange ¶
type ErrNotDefined ¶
type ErrNotDefined struct {
What string
}
func (*ErrNotDefined) Error ¶
func (err *ErrNotDefined) Error() string
type Implementation ¶
type Implementation interface { Install(alias string, repo string, ctx ActionContext) (*data.Agent, error) Upgrade(agent *data.Agent, ctx ActionContext) error Remove(agent *data.Agent, ctx ActionContext) error Start(agent *data.Agent, ctx ActionContext) error Stop(alias string, ctx ActionContext) error StopWithTimeout(alias string, ctx ActionContext, timeout time.Duration) error Kill(alias string, ctx ActionContext) error Restart(agent *data.Agent, ctx ActionContext) error Status(alias string, ctx ActionContext) (status string, err error) Statuses(ctx ActionContext) (statuses map[string]string, err error) AgentStateChangeFeed() <-chan *AgentStateChange CloseAgentStateChangeFeed() Terminate(timeout time.Duration) }
type Supervisor ¶
type Supervisor struct {
// contains filtered or unexported fields
}
func New ¶
func New(impl Implementation, workspace, mgoURL, token string, logs *log.Publisher) (*Supervisor, error)
func (*Supervisor) ExportManagementMethods ¶
func (sup *Supervisor) ExportManagementMethods(client *rpc.Service) (err error)
func (*Supervisor) Terminate ¶
func (sup *Supervisor) Terminate()
func (*Supervisor) TerminateWithin ¶
func (sup *Supervisor) TerminateWithin(timeout time.Duration)
func (*Supervisor) Terminated ¶
func (sup *Supervisor) Terminated() <-chan struct{}
Click to show internal directories.
Click to hide internal directories.