node

package
v0.2.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 13, 2019 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	LOG_LEVEL_FAILURE = 0
	LOG_LEVEL_WARNING = 1
	LOG_LEVEL_SUCCESS = 2
	LOG_LEVEL_INFO    = 3
	LOG_LEVEL_DEBUG   = 4
)
View Source
const (
	Disabled = iota
	Enabled
)

Variables

View Source
var DisabledPlugins = make(map[string]bool)
View Source
var EnabledPlugins = make(map[string]bool)

Functions

func GetPluginIdentifier

func GetPluginIdentifier(name string) string

func Shutdown

func Shutdown()

Types

type Callback

type Callback = func(plugin *Plugin)

type Node

type Node struct {
	Logger *logger.Logger
	// contains filtered or unexported fields
}

func New

func New(plugins ...*Plugin) *Node

func Run

func Run(plugins ...*Plugin) *Node

func Start

func Start(plugins ...*Plugin) *Node

func (*Node) Run

func (node *Node) Run()

func (*Node) Start

func (node *Node) Start()

type Plugin

type Plugin struct {
	Node   *Node
	Name   string
	Status int
	Events pluginEvents
	// contains filtered or unexported fields
}

func NewPlugin

func NewPlugin(name string, status int, callback Callback, callbacks ...Callback) *Plugin

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL