Documentation ¶
Index ¶
Constants ¶
const ( Disabled = iota Enabled )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CorePlugin ¶
type CorePlugin struct {
Pluggable
}
CorePlugin is a plugin essential for node operation. It can not be disabled.
func (*CorePlugin) Daemon ¶
func (c *CorePlugin) Daemon() daemon.Daemon
type CorePluginForEachFunc ¶
type CorePluginForEachFunc func(corePlugin *CorePlugin) bool
CorePluginForEachFunc is used in ForEachCorePlugin. Returning false indicates to stop looping.
type InitConfig ¶
InitConfig describes the result of a node initialization.
type InitPlugin ¶
type InitPlugin struct { Pluggable // Init gets called in the initialization stage of the node. Init InitFunc // The configs this InitPlugin brings to the node. Configs map[string]*configuration.Configuration }
InitPlugin is the module initializing configuration of the node. A Node can only have one of such modules.
type Node ¶
func New ¶
func New(optionalOptions ...NodeOption) *Node
func Run ¶
func Run(optionalOptions ...NodeOption) *Node
func Start ¶
func Start(optionalOptions ...NodeOption) *Node
func (*Node) ForEachCorePlugin ¶
func (n *Node) ForEachCorePlugin(f CorePluginForEachFunc)
ForEachCorePlugin calls the given CorePluginForEachFunc on each loaded core plugins.
func (*Node) ForEachPlugin ¶
func (n *Node) ForEachPlugin(f PluginForEachFunc)
ForEachPlugin calls the given PluginForEachFunc on each loaded plugin.
type NodeOption ¶
type NodeOption func(opts *NodeOptions)
NodeOption is a function setting a NodeOptions option.
func WithCorePlugins ¶
func WithCorePlugins(corePlugins ...*CorePlugin) NodeOption
WithCorePlugins sets the core plugins.
func WithInitPlugin ¶
func WithInitPlugin(initPlugin *InitPlugin) NodeOption
WithInitPlugin sets the init plugin.
type NodeOptions ¶
type NodeOptions struct {
// contains filtered or unexported fields
}
NodeOptions defines options for a Node.
type Pluggable ¶
type Pluggable struct { // A reference to the Node instance. Node *Node // The name of the plugin. Name string // The config parameters for this plugin. Params *PluginParams // The function to call to initialize the plugin dependencies. DepsFunc interface{} // Provide gets called in the provide stage of node initialization. Provide ProvideFunc // Configure gets called in the configure stage of node initialization. Configure Callback // Run gets called in the run stage of node initialization. Run Callback }
Pluggable is something which extends the Node's capabilities.
type Plugin ¶
func (*Plugin) GetIdentifier ¶
type PluginForEachFunc ¶
PluginForEachFunc is used in ForEachPlugin. Returning false indicates to stop looping.
type PluginParams ¶
type PluginParams struct { // The parameters of the plugin under for the defined configuration. Params map[string]*flag.FlagSet // The configuration values to mask. Masked []string }
PluginParams defines the parameters configuration of a plugin.
type ProvideFunc ¶
ProvideFunc gets called with a dig.Container.