Documentation ¶
Index ¶
- type Agent
- type AgentReply
- type Manager
- func (a *Manager) Choria() *choria.Framework
- func (a *Manager) DenyAgent(agent string)
- func (a *Manager) Dispatch(ctx context.Context, wg *sync.WaitGroup, replies chan *AgentReply, ...)
- func (a *Manager) Get(name string) (Agent, bool)
- func (a *Manager) KnownAgents() []string
- func (a *Manager) Logger() *logrus.Entry
- func (a *Manager) RegisterAgent(ctx context.Context, name string, agent Agent, conn choria.AgentConnector) error
- type Metadata
- type ServerInfoSource
- type ServerStats
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Agent ¶
type Agent interface { Metadata() *Metadata Name() string HandleMessage(context.Context, *choria.Message, protocol.Request, choria.ConnectorInfo, chan *AgentReply) SetServerInfo(ServerInfoSource) ServerInfo() ServerInfoSource ShouldActivate() bool }
Agent is a generic choria agent
type AgentReply ¶
type Manager ¶
type Manager struct {
// contains filtered or unexported fields
}
func New ¶
func New(requests chan *choria.ConnectorMessage, fw *choria.Framework, conn choria.ConnectorInfo, srv ServerInfoSource, log *logrus.Entry) *Manager
New creates a new Agent Manager
func (*Manager) KnownAgents ¶
KnownAgents retrieves a list of known agents
func (*Manager) RegisterAgent ¶
func (a *Manager) RegisterAgent(ctx context.Context, name string, agent Agent, conn choria.AgentConnector) error
RegisterAgent connects a new agent to the server instance, subscribe to all its targets etc
type ServerInfoSource ¶
type ServerInfoSource interface { KnownAgents() []string AgentMetadata(string) (Metadata, bool) ConfigFile() string Classes() []string Facts() json.RawMessage StartTime() time.Time Stats() ServerStats NewEvent(t lifecycle.Type, opts ...lifecycle.Option) error MachinesStatus() ([]aagent.MachineState, error) MachineTransition(name string, version string, path string, id string, transition string) error }
ServerInfoSource provides data about a running server instance
Click to show internal directories.
Click to hide internal directories.