Documentation ¶
Overview ¶
Package bees is Beehive's central module system.
Package bees is Beehive's central module system.
Package bees is Beehive's central module system.
Package bees is Beehive's central module system.
Package bees is Beehive's central module system.
Package bees is Beehive's central module system.
Package bees is Beehive's central module system.
Package bees is Beehive's central module system.
Package bees is Beehive's central module system.
Package bees is Beehive's central module system.
Package bees is Beehive's central module system.
Package bees is Beehive's central module system.
Index ¶
- func ConvertValue(v interface{}, dst interface{}) error
- func DeleteBee(bee *BeeInterface)
- func Log(bee string, message string, messageType MessageType)
- func RegisterBee(bee BeeInterface)
- func RegisterFactory(factory BeeFactoryInterface)
- func RestartBee(bee *BeeInterface)
- func RestartBees(bees []BeeConfig)
- func SetActions(as []Action)
- func SetChains(cs []Chain)
- func StartBees(beeList []BeeConfig)
- func StopBees()
- func UUID() string
- type Action
- type ActionDescriptor
- type Bee
- func (bee *Bee) Action(action Action) []Placeholder
- func (bee *Bee) Config() BeeConfig
- func (bee *Bee) ContextSet(key string, value interface{})
- func (bee *Bee) ContextValue(key string) interface{}
- func (bee *Bee) Description() string
- func (bee *Bee) IsRunning() bool
- func (bee *Bee) LastAction() time.Time
- func (bee *Bee) LastEvent() time.Time
- func (bee *Bee) LogAction()
- func (bee *Bee) LogDebugf(format string, args ...interface{})
- func (bee *Bee) LogErrorf(format string, args ...interface{})
- func (bee *Bee) LogEvent()
- func (bee *Bee) LogFatal(args ...interface{})
- func (bee *Bee) Logf(format string, args ...interface{})
- func (bee *Bee) Logln(args ...interface{})
- func (bee *Bee) Name() string
- func (bee *Bee) Namespace() string
- func (bee *Bee) Options() BeeOptions
- func (bee *Bee) Run(chan Event)
- func (bee *Bee) SetDescription(s string)
- func (bee *Bee) SetOptions(options BeeOptions)
- func (bee *Bee) SetSigChan(c chan bool)
- func (bee *Bee) Start()
- func (bee *Bee) Stop()
- func (bee *Bee) WaitGroup() *sync.WaitGroup
- type BeeConfig
- type BeeFactory
- func (factory *BeeFactory) Actions() []ActionDescriptor
- func (factory *BeeFactory) Events() []EventDescriptor
- func (factory *BeeFactory) Image() string
- func (factory *BeeFactory) LogoColor() string
- func (factory *BeeFactory) OAuth2AccessToken(id, secret, code string) (*oauth2.Token, error)
- func (factory *BeeFactory) Options() []BeeOptionDescriptor
- func (factory *BeeFactory) States() []StateDescriptor
- type BeeFactoryInterface
- type BeeInterface
- type BeeOption
- type BeeOptionDescriptor
- type BeeOptions
- type Chain
- type ChainElement
- type Context
- type Event
- type EventDescriptor
- type Filter
- type FilterOption
- type LogMessage
- type LogSorter
- type MessageType
- type Placeholder
- type PlaceholderDescriptor
- type Placeholders
- type StateDescriptor
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ConvertValue ¶
func ConvertValue(v interface{}, dst interface{}) error
ConvertValue tries to convert v to dst.
func Log ¶
func Log(bee string, message string, messageType MessageType)
Log adds a new LogMessage to the log
func RegisterBee ¶
func RegisterBee(bee BeeInterface)
RegisterBee gets called by Bees to register themselves.
func RegisterFactory ¶
func RegisterFactory(factory BeeFactoryInterface)
RegisterFactory gets called by BeeFactories to register themselves.
func RestartBees ¶
func RestartBees(bees []BeeConfig)
RestartBees stops all running bees and restarts a new set of bees.
Types ¶
type Action ¶
type Action struct { ID string Bee string Name string Options Placeholders }
Action describes an action.
type ActionDescriptor ¶
type ActionDescriptor struct { Namespace string Name string Description string Options []PlaceholderDescriptor }
ActionDescriptor describes an Action provided by a Bee.
func GetActionDescriptor ¶
func GetActionDescriptor(action *Action) ActionDescriptor
GetActionDescriptor returns the ActionDescriptor matching an action.
type Bee ¶
Bee is the base-struct to be embedded by bee implementations.
func (*Bee) Action ¶
func (bee *Bee) Action(action Action) []Placeholder
Action is the default, empty implementation of a Bee's Action method.
func (*Bee) ContextSet ¶ added in v0.3.2
func (*Bee) ContextValue ¶ added in v0.3.2
func (*Bee) Description ¶
Description returns the description for a bee.
func (*Bee) LastAction ¶
LastAction returns the timestamp of the last triggered action.
func (*Bee) SetDescription ¶
SetDescription sets the description for a bee.
func (*Bee) SetOptions ¶
func (bee *Bee) SetOptions(options BeeOptions)
SetOptions sets the options for a bee.
func (*Bee) SetSigChan ¶
SetSigChan sets the signaling channel for a bee.
type BeeConfig ¶
type BeeConfig struct { Name string Class string Description string Options BeeOptions }
BeeConfig contains all settings for a single Bee.
func NewBeeConfig ¶
func NewBeeConfig(name, class, description string, options BeeOptions) (BeeConfig, error)
NewBeeConfig validates a configuration and sets up a new BeeConfig
type BeeFactory ¶
type BeeFactory struct { }
A BeeFactory is the base struct to be embedded by other BeeFactories.
func (*BeeFactory) Actions ¶
func (factory *BeeFactory) Actions() []ActionDescriptor
Actions returns the default empty actions set.
func (*BeeFactory) Events ¶
func (factory *BeeFactory) Events() []EventDescriptor
Events returns the default empty events set.
func (*BeeFactory) Image ¶
func (factory *BeeFactory) Image() string
Image returns an empty image filename per default.
func (*BeeFactory) LogoColor ¶
func (factory *BeeFactory) LogoColor() string
LogoColor returns the default logo color.
func (*BeeFactory) OAuth2AccessToken ¶
func (factory *BeeFactory) OAuth2AccessToken(id, secret, code string) (*oauth2.Token, error)
OAuth2AccessToken returns the oauth2 access token.
func (*BeeFactory) Options ¶
func (factory *BeeFactory) Options() []BeeOptionDescriptor
Options returns the default empty options set.
func (*BeeFactory) States ¶ added in v0.3.2
func (factory *BeeFactory) States() []StateDescriptor
States returns the default empty states set.
type BeeFactoryInterface ¶
type BeeFactoryInterface interface { // ID of the module ID() string // Name of the module Name() string // Description of the module Description() string // An image url for the module Image() string // A logo color for the module LogoColor() string // OAuth2AccessToken returns the oauth2 access token. OAuth2AccessToken(id, secret, code string) (*oauth2.Token, error) // Options supported by module Options() []BeeOptionDescriptor // States provided by module States() []StateDescriptor // Events defined by module Events() []EventDescriptor // Actions supported by module Actions() []ActionDescriptor New(name, description string, options BeeOptions) BeeInterface }
A BeeFactoryInterface is the interface that gets implemented by a BeeFactory.
func GetFactories ¶
func GetFactories() []*BeeFactoryInterface
GetFactories returns all known bee factories.
func GetFactory ¶
func GetFactory(identifier string) *BeeFactoryInterface
GetFactory returns the factory with a specific name.
type BeeInterface ¶
type BeeInterface interface { // Name of the bee Name() string // Namespace of the bee Namespace() string // Description of the bee Description() string // SetDescription sets a description SetDescription(s string) // Config returns this bees config Config() BeeConfig // Options of the bee Options() BeeOptions // SetOptions to configure the bee SetOptions(options BeeOptions) // ReloadOptions gets called after a bee's options get updated ReloadOptions(options BeeOptions) // Activates the bee Run(eventChannel chan Event) // Running returns the current state of the bee IsRunning() bool // Start the bee Start() // Stop the bee Stop() LastEvent() time.Time LogEvent() LastAction() time.Time LogAction() Logln(args ...interface{}) Logf(format string, args ...interface{}) LogErrorf(format string, args ...interface{}) LogFatal(args ...interface{}) SetSigChan(c chan bool) WaitGroup() *sync.WaitGroup // Handles an action Action(action Action) []Placeholder }
BeeInterface is an interface all bees implement.
func GetBee ¶
func GetBee(identifier string) *BeeInterface
GetBee returns a bee with a specific name.
func NewBeeInstance ¶
func NewBeeInstance(bee BeeConfig) *BeeInterface
NewBeeInstance sets up a new Bee with supplied config.
type BeeOption ¶
type BeeOption struct { Name string Value interface{} }
A BeeOption is used to configure bees.
type BeeOptionDescriptor ¶
type BeeOptionDescriptor struct { Name string Description string Type string Default interface{} Mandatory bool }
A BeeOptionDescriptor shows which config values a module expects.
type BeeOptions ¶
type BeeOptions []BeeOption
BeeOptions is an array of BeeOption.
func (BeeOptions) Bind ¶
func (opts BeeOptions) Bind(name string, dst interface{}) error
Bind a value from a BeeOptions slice.
func (BeeOptions) Value ¶
func (opts BeeOptions) Value(name string) interface{}
Value retrieves a value from a BeeOptions slice.
type Chain ¶
type Chain struct { Name string Description string Event *Event Filters []string Actions []string Elements []ChainElement `json:"Elements,omitempty"` }
Chain is a user defined chain
type ChainElement ¶
ChainElement is an element in a Chain
type Context ¶ added in v0.3.2
type Context struct {
// contains filtered or unexported fields
}
func NewContext ¶ added in v0.3.2
func NewContext() *Context
type Event ¶
type Event struct { Bee string Name string Options Placeholders }
An Event describes an event including its parameters.
type EventDescriptor ¶
type EventDescriptor struct { Namespace string Name string Description string Options []PlaceholderDescriptor }
EventDescriptor describes an Event provided by a Bee.
func GetEventDescriptor ¶
func GetEventDescriptor(event *Event) EventDescriptor
GetEventDescriptor returns the EventDescriptor matching an event.
type Filter ¶
type Filter struct { ID string Name string Options FilterOption }
Filter describes a user configured event filter.
type FilterOption ¶
type FilterOption struct { Name string Type string Inverse bool CaseInsensitive bool Trimmed bool Value interface{} }
A FilterOption used by filters.
type LogMessage ¶
LogMessage stores a log message with its timestamp, type and originating Bee
func NewLogMessage ¶
func NewLogMessage(bee string, message string, messageType MessageType) LogMessage
NewLogMessage returns a newly composed LogMessage
type LogSorter ¶
type LogSorter []LogMessage
LogSorter is used for sorting an array of LogMessages by their timestamp
type MessageType ¶ added in v0.3.2
type MessageType uint
MessageType defines the log level of the log entry we're dealing with
const ( // LogInfo is for info-level log entries LogInfo MessageType = iota // LogError is for error-level log entries LogError MessageType = iota // LogFatal is for fatal-level log entries LogFatal MessageType = iota // LogDebug is for debug-level log entries LogDebug MessageType = iota )
type Placeholder ¶
Placeholder used by ins & outs of a bee.
type PlaceholderDescriptor ¶
A PlaceholderDescriptor shows which in & out values a module expects and returns.
type Placeholders ¶
type Placeholders []Placeholder
Placeholders is an array of Placeholder.
func (Placeholders) Bind ¶
func (ph Placeholders) Bind(name string, dst interface{}) error
Bind a value from a Placeholder slice.
func (*Placeholders) SetValue ¶
func (ph *Placeholders) SetValue(name string, _type string, value interface{})
SetValue sets a value in the Placeholder slice.
func (Placeholders) Value ¶
func (ph Placeholders) Value(name string) interface{}
Value retrieves a value from a Placeholder slice.
type StateDescriptor ¶ added in v0.3.2
StateDescriptor describes a State provided by a Bee.
Source Files ¶
Directories ¶
Path | Synopsis |
---|---|
Package alertoverbee is able to send notifications on AlertOver.
|
Package alertoverbee is able to send notifications on AlertOver. |
Package anelpowerctrlbee is a Bee for talking to Anel's PowerCtrl network power sockets.
|
Package anelpowerctrlbee is a Bee for talking to Anel's PowerCtrl network power sockets. |
Package cleverbotbee is a Bee that can interact with cleverbot
|
Package cleverbotbee is a Bee that can interact with cleverbot |
Package cronbee is a Bee that acts like a time-based job scheduler (cron).
|
Package cronbee is a Bee that acts like a time-based job scheduler (cron). |
cron
Package cron allows you to schedule events.
|
Package cron allows you to schedule events. |
Package devrantbee is a Bee that can post blogs & quotes on Devrant.
|
Package devrantbee is a Bee that can post blogs & quotes on Devrant. |
Package discordbee is a bee for sending and receiving messages with Discord servers.
|
Package discordbee is a bee for sending and receiving messages with Discord servers. |
Package efabee is a Bee that interfaces with the public EVA API.
|
Package efabee is a Bee that interfaces with the public EVA API. |
Package emailbee is a Bee that is able to send emails.
|
Package emailbee is a Bee that is able to send emails. |
Package execbee is a Bee that can launch external processes.
|
Package execbee is a Bee that can launch external processes. |
Package facebookbee is a Bee that can interface with Facebook.
|
Package facebookbee is a Bee that can interface with Facebook. |
Package githubbee is a Bee that can interface with GitHub Package githubbee is a Bee that can interface with GitHub Package githubbee is a Bee that can interface with GitHub
|
Package githubbee is a Bee that can interface with GitHub Package githubbee is a Bee that can interface with GitHub Package githubbee is a Bee that can interface with GitHub |
Package gitterbee is a Bee that can interface with Gitter Package gitterbee is a Bee that can interface with Gitter
|
Package gitterbee is a Bee that can interface with Gitter Package gitterbee is a Bee that can interface with Gitter |
Package hellobee is an example for a Bee skeleton, designed to help you get started with writing your own Bees.
|
Package hellobee is an example for a Bee skeleton, designed to help you get started with writing your own Bees. |
Package htmlextractbee is a Bee that can extract metadata from HTTP URLs.
|
Package htmlextractbee is a Bee that can extract metadata from HTTP URLs. |
Package httpbee is a Bee that lets you trigger HTTP requests.
|
Package httpbee is a Bee that lets you trigger HTTP requests. |
Package huebee is a Bee that can talk to Philips Hue bridges.
|
Package huebee is a Bee that can talk to Philips Hue bridges. |
Package ircbee is a Bee that can connect to an IRC server.
|
Package ircbee is a Bee that can connect to an IRC server. |
irctools
Package irctools is a collection of convenient IRC styling methods.
|
Package irctools is a collection of convenient IRC styling methods. |
Package jabberbee is a Bee that can connect to a Jabber/XMPP server.
|
Package jabberbee is a Bee that can connect to a Jabber/XMPP server. |
Package jenkinsbee is a Bee that can interface with a Jenkins server.
|
Package jenkinsbee is a Bee that can interface with a Jenkins server. |
* Copyright (C) 2020 Christian Muehlhaeuser * 2020 Nicolas Martin * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as published * by the Free Software Foundation, either version 3 of the License, or * (at your option) any later version.
|
* Copyright (C) 2020 Christian Muehlhaeuser * 2020 Nicolas Martin * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as published * by the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. |
Package mumblebee is a Bee that can connect to a Mumble/XMPP server.
|
Package mumblebee is a Bee that can connect to a Mumble/XMPP server. |
Package nagiosbee is a Bee that can interface with a Nagios instance.
|
Package nagiosbee is a Bee that can interface with a Nagios instance. |
Package notificationbee is a Bee that can trigger desktop notifications.
|
Package notificationbee is a Bee that can trigger desktop notifications. |
Package openweathermapbee is a Bee that can interact with cleverbot
|
Package openweathermapbee is a Bee that can interact with cleverbot |
Package pastebinbee is a Bee that can interface with Pastebin.
|
Package pastebinbee is a Bee that can interface with Pastebin. |
Package prometheusbee is a bee designed to expose metrics for scraping by Prometheus.
|
Package prometheusbee is a bee designed to expose metrics for scraping by Prometheus. |
Package pushoverbee is a Bee that can send pushover notifications.
|
Package pushoverbee is a Bee that can send pushover notifications. |
Package rocketchatbee is a Bee that can connect to Rocketchat.
|
Package rocketchatbee is a Bee that can connect to Rocketchat. |
Package rssbee is a Bee for handling RSS feeds.
|
Package rssbee is a Bee for handling RSS feeds. |
Package serialbee is a Bee that can send & receive data on a serial port.
|
Package serialbee is a Bee that can send & receive data on a serial port. |
Package simplepushbee is a Bee that is able to send push notifications to Android.
|
Package simplepushbee is a Bee that is able to send push notifications to Android. |
Package slackbee is a Bee that can connect to Slack.
|
Package slackbee is a Bee that can connect to Slack. |
Package socketbee is a Bee that lets you transmit data via UDP sockets.
|
Package socketbee is a Bee that lets you transmit data via UDP sockets. |
Package spaceapibee is a Bee that can query a spaceapi server.
|
Package spaceapibee is a Bee that can query a spaceapi server. |
Package telegrambee is a Bee that can connect to Telegram.
|
Package telegrambee is a Bee that can connect to Telegram. |
Package timebee is a Bee that can fire events at a specific time.
|
Package timebee is a Bee that can fire events at a specific time. |
Package transmissionbee is a Bee that can send torrents to Transmission.
|
Package transmissionbee is a Bee that can send torrents to Transmission. |
Package travisbee is a bee for monitoring and reacting to the status of TravisCI builds.
|
Package travisbee is a bee for monitoring and reacting to the status of TravisCI builds. |
Package tumblrbee is a Bee that can post blogs & quotes on Tumblr.
|
Package tumblrbee is a Bee that can post blogs & quotes on Tumblr. |
Package twiliobee is a Bee that is able to send SMS messages.
|
Package twiliobee is a Bee that is able to send SMS messages. |
Package twitchbee is a Bee that can connect to Twitch.
|
Package twitchbee is a Bee that can connect to Twitch. |
Package twitterbee is a Bee that can interface with Twitter.
|
Package twitterbee is a Bee that can interface with Twitter. |
Package webbee is a Bee that starts an HTTP server and fires events for incoming requests.
|
Package webbee is a Bee that starts an HTTP server and fires events for incoming requests. |