Documentation ¶
Index ¶
- func RegisterAdditionalAgent(i AgentInitializer)
- func RegisterAdditionalAgentProvider(p AgentProvider)
- type AgentInitializer
- type AgentManager
- type AgentProvider
- type Instance
- func (srv *Instance) AgentMetadata(agent string) (agents.Metadata, bool)
- func (srv *Instance) BuildInfo() *build.Info
- func (srv *Instance) Choria() *choria.Framework
- func (srv *Instance) Classes() []string
- func (srv *Instance) ConfigFile() string
- func (srv *Instance) ConnectedServer() string
- func (srv *Instance) DataFuncMap() (ddl.FuncMap, error)
- func (srv *Instance) DenyAgent(agent string)
- func (srv *Instance) Facts() json.RawMessage
- func (srv *Instance) Identity() string
- func (srv *Instance) KnownAgents() []string
- func (srv *Instance) LastProcessedMessage() time.Time
- func (srv *Instance) Logger(component string) *log.Entry
- func (srv *Instance) MachineTransition(name string, version string, path string, id string, transition string) error
- func (srv *Instance) MachinesStatus() ([]aagent.MachineState, error)
- func (srv *Instance) MachinesStatusJSON() (json.RawMessage, error)
- func (srv *Instance) NewEvent(t lifecycle.Type, opts ...lifecycle.Option) error
- func (srv *Instance) PrepareForShutdown() error
- func (srv *Instance) PrometheusTextFileDir() string
- func (srv *Instance) Provisioning() bool
- func (srv *Instance) PublishEvent(e lifecycle.Event) error
- func (srv *Instance) PublishRaw(target string, data []byte) error
- func (srv *Instance) RegisterAgent(ctx context.Context, name string, agent agents.Agent) error
- func (srv *Instance) RegisterRegistrationProvider(ctx context.Context, wg *sync.WaitGroup, ...) error
- func (srv *Instance) Run(ctx context.Context, wg *sync.WaitGroup) error
- func (srv *Instance) ScoutOverridesPath() string
- func (srv *Instance) ServerStatusFile() (string, int)
- func (srv *Instance) SetComponent(c string)
- func (srv *Instance) Shutdown() error
- func (srv *Instance) StartDataProviders(ctx context.Context) (err error)
- func (srv *Instance) StartMachine(ctx context.Context, wg *sync.WaitGroup) (err error)
- func (srv *Instance) StartTime() time.Time
- func (srv *Instance) Stats() statistics.ServerStats
- func (srv *Instance) Status() *statistics.InstanceStatus
- func (srv *Instance) UpTime() int64
- func (srv *Instance) WriteServerStatus(ctx context.Context, wg *sync.WaitGroup)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RegisterAdditionalAgent ¶
func RegisterAdditionalAgent(i AgentInitializer)
RegisterAdditionalAgent adds an agent to a running server this should be used for compile time injection of agents other than the ones that ship with choria
func RegisterAdditionalAgentProvider ¶
func RegisterAdditionalAgentProvider(p AgentProvider)
RegisterAdditionalAgentProvider registers an agent provider as a subsystem capable of delivering new types of agent like the legacy mcollective ruby compatible ones
Custom builders can use this to extend choria with new agent capabilities
Types ¶
type AgentInitializer ¶
type AgentInitializer func(context.Context, *agents.Manager, choria.InstanceConnector, *logrus.Entry) error
AgentInitializer is a function signature for a function that can register an agent
type AgentManager ¶
type AgentProvider ¶
type AgentProvider interface { Initialize(fw *choria.Framework, log *logrus.Entry) RegisterAgents(ctx context.Context, mgr AgentManager, connector choria.InstanceConnector, log *logrus.Entry) error Version() string }
AgentProvider is capable of adding agents into a running instance
type Instance ¶
type Instance struct {
// contains filtered or unexported fields
}
Instance is an independent copy of Choria
func NewInstance ¶
NewInstance creates a new choria server instance
func (*Instance) AgentMetadata ¶
AgentMetadata looks up the metadata for a specific agent
func (*Instance) BuildInfo ¶ added in v0.20.0
BuildInfo is the compile time settings for this process
func (*Instance) ConfigFile ¶
ConfigFile determines the config file used to start the instance
func (*Instance) ConnectedServer ¶
ConnectedServer returns the URL of the broker this instance is connected to, "unknown" when not connected
func (*Instance) DataFuncMap ¶ added in v0.20.0
DataFuncMap returns the list of known data plugins
func (*Instance) DenyAgent ¶
DenyAgent prevents an agent from being loaded, if it was already loaded this has no effect
func (*Instance) Facts ¶
func (srv *Instance) Facts() json.RawMessage
Facts are all the known facts to this instance
func (*Instance) KnownAgents ¶
KnownAgents is a list of agents loaded into the server instance
func (*Instance) LastProcessedMessage ¶
LastProcessedMessage is the time that the last message was processed in local time
func (*Instance) MachineTransition ¶
func (srv *Instance) MachineTransition(name string, version string, path string, id string, transition string) error
MachineTransition sends a transition event to a specific running machine instance
func (*Instance) MachinesStatus ¶
func (srv *Instance) MachinesStatus() ([]aagent.MachineState, error)
MachinesStatus returns the status of all loaded autonomous agents
func (*Instance) MachinesStatusJSON ¶ added in v0.20.0
func (srv *Instance) MachinesStatusJSON() (json.RawMessage, error)
MachinesStatusJSON returns the status of all loaded autonomous agents
func (*Instance) NewEvent ¶
NewEvent creates a new event with the server component and identity set and publishes it
func (*Instance) PrepareForShutdown ¶ added in v0.15.0
PrepareForShutdown stops processing incoming requests without shutting down the whole server the network connection is closed and no new messages or replies are handled but the server keeps running, this will allow for shutdowns and restarts without duplicate handling of messages
func (*Instance) PrometheusTextFileDir ¶ added in v0.15.0
PrometheusTextFileDir is the directory prometheus textfiles should be written to
func (*Instance) Provisioning ¶
Provisioning determines if this is an instance running in provisioning mode
func (*Instance) PublishEvent ¶
PublishEvent publishes a lifecycle event to the network
func (*Instance) PublishRaw ¶
PublishRaw allows publishing to the connected middleware
func (*Instance) RegisterAgent ¶
RegisterAgent adds a new agent to the running instance
func (*Instance) RegisterRegistrationProvider ¶
func (srv *Instance) RegisterRegistrationProvider(ctx context.Context, wg *sync.WaitGroup, provider registration.RegistrationDataProvider) error
RegisterRegistrationProvider adds a new provider for registration data to the registration subsystem
func (*Instance) ScoutOverridesPath ¶ added in v0.15.0
ScoutOverridesPath is the path to a file defining node specific scout overrides
func (*Instance) ServerStatusFile ¶ added in v0.19.0
ServerStatusFile is the path where the server writes it's status file regularly and how frequently
func (*Instance) SetComponent ¶
SetComponent sets the component name this server will report in its lifecycle events. "server" and "provision_mode_server" are the defaults
func (*Instance) StartDataProviders ¶ added in v0.20.0
func (*Instance) StartMachine ¶
StartMachine starts the choria machine instances
func (*Instance) Stats ¶
func (srv *Instance) Stats() statistics.ServerStats
Stats expose server statistics
func (*Instance) Status ¶
func (srv *Instance) Status() *statistics.InstanceStatus
Status calculates the current server status