Documentation ¶
Overview ¶
Package actions provides types and interfaces necessary to write event sources
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetEventSourcesList ¶
func GetEventSourcesList() (sources []string)
GetEventSourcesList returns the list of all event sources.
func RegisterEventSource ¶
func RegisterEventSource(name string, ds EventSourceInterface)
RegisterEventSource registers the event source. Must be called from the init() of the event sources.
func SetupEventSources ¶
func SetupEventSources(ch chan EventData, cfp configprovider.ConfigProviderInterface, dslist []string)
SetupEventSources gets the configuration and calls the Setup() function of the event sources in dslist.
Types ¶
type ArgType ¶
ArgType describes the different arguments and their types that an action needs as input. It is only used for humans so you can set arbitrary strings to describe the argument.
type EventData ¶
EventData represents an event. It is sent from a eventsource. Name is the name of the event and Data is an arbitrary map containing the event data.
type EventSourceInterface ¶
type EventSourceInterface interface { Setup(ch chan EventData, config []byte) error Events() map[string][]ArgType }
EventSourceInterface is the interface event sources must implement. Setup() is called once when CSF starts and is used to configure and or init modules. Events() returns a map where Keys are events name and values are lists of parameters of the event.