Documentation
¶
Index ¶
- func GetAgent(name string) interface{}
- func RegisterAgent(name string, agent interface{})
- func RegisterNotifier(name string, notifier interface{})
- func ValidateResultKeyRune(r rune) bool
- type Agent
- type AgentDescription
- type AgentResult
- type ArgumentDescription
- type Notifier
- type NotifierDescription
- type RemoteAgent
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetAgent ¶
func GetAgent(name string) interface{}
GetAgent will return an agent registered with the name.
func RegisterAgent ¶
func RegisterAgent(name string, agent interface{})
RegisterAgent will register the agent with the agent store.
func RegisterNotifier ¶
func RegisterNotifier(name string, notifier interface{})
RegisterNotifier will register the notifier with the notifier store.
func ValidateResultKeyRune ¶
ValidateResultKeyRune returns true for a rune allowed in a AgentResult key.
Types ¶
type Agent ¶
type Agent interface {
// Check should run the agents check.
Check(result AgentResult) error
}
Agent should be implemented by all agents. An agent is the entity responsible for carrying out all checks.
type AgentDescription ¶
type AgentDescription struct {
Name string `json:"name"`
Remote bool `json:"remote"`
Arguments []ArgumentDescription `json:"arguments"`
}
AgentDescription describes an agent.
type AgentResult ¶
type AgentResult map[string]interface{}
AgentResult describes the result from an agent.
func NewAgentResult ¶
func NewAgentResult() AgentResult
NewAgentResult will instanmtiate a new AgentResult ready for passing to an agent.
func (AgentResult) AddValue ¶
func (a AgentResult) AddValue(key string, value interface{})
AddValue will add a result value.
type ArgumentDescription ¶
type ArgumentDescription struct {
Name string `json:"name"`
Type string `json:"type"`
Description string `json:"description"`
Default string `json:"default"`
EnumValues []string `json:"enum"`
}
ArgumentDescription contains everything needed for creating a GUI for configuring a plugin.
type Notifier ¶
Notifier must be implemented by plugins capable of delivering notifications.
func GetNotifier ¶
GetNotifier will return a notifier registred with the name.
type NotifierDescription ¶
type NotifierDescription struct {
Name string `json:"name"`
Arguments []ArgumentDescription `json:"arguments"`
}
NotifierDescription describes a notifier.
func ListNotifiers ¶
func ListNotifiers() []NotifierDescription
ListNotifiers will return a list of all agents.
type RemoteAgent ¶
type RemoteAgent interface {
RemoteCheck(transport transports.Transport, result AgentResult) error
}
RemoteAgent should be implemented for all agents supporting a transport.