Documentation ¶
Index ¶
- Constants
- Variables
- func AddPlugin(plugin *Plugin)
- func GetPluginIdentifier(name string) string
- func GetPlugins() map[string]*Plugin
- func IsSkipped(plugin *Plugin) bool
- func Shutdown()
- type AddEvent
- type Callback
- type ConfigureEvent
- type InitEvent
- type Node
- type NodeEvents
- type NodeOption
- type NodeOptions
- type Plugin
- func (p *Plugin) LogDebug(args ...interface{})
- func (p *Plugin) LogDebugf(format string, args ...interface{})
- func (p *Plugin) LogError(args ...interface{})
- func (p *Plugin) LogErrorAndExit(args ...interface{})
- func (p *Plugin) LogErrorf(format string, args ...interface{})
- func (p *Plugin) LogErrorfAndExit(format string, args ...interface{})
- func (p *Plugin) LogFatalAndExit(args ...interface{})
- func (p *Plugin) LogFatalfAndExit(format string, args ...interface{})
- func (p *Plugin) LogInfo(args ...interface{})
- func (p *Plugin) LogInfof(format string, args ...interface{})
- func (p *Plugin) LogWarn(args ...interface{})
- func (p *Plugin) LogWarnf(format string, args ...interface{})
- func (p *Plugin) Logger() *logger.Logger
- func (p *Plugin) Panic(args ...interface{})
- func (p *Plugin) Panicf(template string, args ...interface{})
- type PluginEvents
- type RunEvent
Constants ¶
const ( Disabled = iota Enabled )
Variables ¶
Functions ¶
func GetPluginIdentifier ¶
func GetPlugins ¶
Types ¶
type ConfigureEvent ¶
type ConfigureEvent struct {
Plugin *Plugin
}
type Node ¶
func New ¶
func New(optionalOptions ...NodeOption) *Node
func Run ¶
func Run(optionalOptions ...NodeOption) *Node
func Start ¶
func Start(optionalOptions ...NodeOption) *Node
type NodeEvents ¶
var Events *NodeEvents
type NodeOption ¶
type NodeOption func(*NodeOptions)
func Daemon ¶
func Daemon(d daemon.Daemon) NodeOption
func Plugins ¶
func Plugins(plugins ...*Plugin) NodeOption
type NodeOptions ¶
type NodeOptions struct {
// contains filtered or unexported fields
}
type Plugin ¶
type Plugin struct { Node *Node Name string Status int Events *PluginEvents // contains filtered or unexported fields }
func NewPlugin ¶
NewPlugin creates a new plugin with the given name, default status and callbacks. The last specified callback is the mandatory run callback, while all other callbacks are configure callbacks.
func (*Plugin) LogDebug ¶
func (p *Plugin) LogDebug(args ...interface{})
LogDebug uses fmt.Sprint to construct and log a message.
func (*Plugin) LogError ¶
func (p *Plugin) LogError(args ...interface{})
LogError uses fmt.Sprint to construct and log a message.
func (*Plugin) LogErrorAndExit ¶
func (p *Plugin) LogErrorAndExit(args ...interface{})
LogErrorAndExit uses fmt.Sprint to construct and log a message, then calls os.Exit.
func (*Plugin) LogErrorfAndExit ¶
LogErrorfAndExit uses fmt.Sprintf to log a templated message, then calls os.Exit.
func (*Plugin) LogFatalAndExit ¶
func (p *Plugin) LogFatalAndExit(args ...interface{})
LogFatalAndExit uses fmt.Sprint to construct and log a message, then calls os.Exit.
func (*Plugin) LogFatalfAndExit ¶
LogFatalfAndExit uses fmt.Sprintf to log a templated message, then calls os.Exit.
func (*Plugin) LogInfo ¶
func (p *Plugin) LogInfo(args ...interface{})
LogInfo uses fmt.Sprint to construct and log a message.
func (*Plugin) LogWarn ¶
func (p *Plugin) LogWarn(args ...interface{})
LogWarn uses fmt.Sprint to construct and log a message.