Documentation ¶
Index ¶
- Variables
- func MapPayload(name string, event *Event) error
- func RandomString(strlen int) string
- func RegisterPlugin(name string, creator Creator, events ...interface{})
- func SliceContains(name string, list []string) bool
- type Action
- type Artifact
- type Caller
- type Config
- type Creator
- type Event
- func (e *Event) AddArtifact(key string, value interface{}, secret bool)
- func (e *Event) CreateEvent(action Action, state State, stateMessage string) Event
- func (e *Event) DeleteEvent(action Action, state State, stateMessage string) Event
- func (e *Event) Dump()
- func (e *Event) Event() string
- func (e *Event) GetArtifact(key string) (Artifact, error)
- func (e *Event) GetArtifactFromSource(key string, source string) (Artifact, error)
- func (e *Event) Matches(name string) bool
- func (e *Event) NewEvent(action Action, state State, stateMessage string) Event
- func (e *Event) SetPayload(payload interface{})
- func (e *Event) StatusEvent(action Action, state State, stateMessage string) Event
- func (e *Event) UpdateEvent(action Action, state State, stateMessage string) Event
- type EventName
- type Plugin
- type RunningPlugin
- type State
- type Transistor
Constants ¶
This section is empty.
Variables ¶
View Source
var EventRegistry = make(map[string]interface{})
View Source
var PluginRegistry = map[string]Creator{}
Functions ¶
func MapPayload ¶
func RandomString ¶
func RegisterPlugin ¶
func SliceContains ¶
Types ¶
type Artifact ¶
type Artifact struct { Source string `json:"source,omitempty"` Key string `json:"key"` Value interface{} `json:"value"` Secret bool `json:"secret"` }
func (*Artifact) StringSlice ¶
func (a *Artifact) StringSlice() []interface{}
type Event ¶
type Event struct { ID uuid.UUID `json:"id"` ParentID uuid.UUID `json:"parentId"` Name EventName `json:"name"` Action Action `json:"action"` State State `json:"state"` StateMessage string `json:"stateMessage"` Payload interface{} `json:"payload"` PayloadModel string `json:"payloadModel"` CreatedAt time.Time `json:"createdAt"` Caller Caller `json:"caller"` Artifacts []Artifact `json:"artifacts"` }
func CreateEvent ¶
func DeleteEvent ¶
func UpdateEvent ¶
func (*Event) AddArtifact ¶
func (*Event) CreateEvent ¶
func (*Event) DeleteEvent ¶
func (*Event) GetArtifactFromSource ¶
func (*Event) SetPayload ¶
func (e *Event) SetPayload(payload interface{})
func (*Event) StatusEvent ¶
type Plugin ¶
type Plugin interface { // Start starts the Plugin service, whatever that may be Start(chan Event) error // Stop stops the services and closes any necessary channels and connections Stop() // Subscribe takes in an event message and validates it for Process Subscribe() []string // Process takes in an event message and tries to process it Process(Event) error }
type RunningPlugin ¶
type Transistor ¶
type Transistor struct { Config Config Events chan Event TestEvents chan Event Shutdown chan struct{} Plugins []*RunningPlugin }
Transistor runs codeflow and collects datt based on the given config
func NewTestTransistor ¶
func NewTestTransistor(config Config) (*Transistor, error)
NewTestTransistor returns an Transistor struct based off the given Config
func NewTransistor ¶
func NewTransistor(config Config) (*Transistor, error)
NewTransistor returns an Transistor struct based off the given Config
func (*Transistor) GetTestEvent ¶
func (*Transistor) LoadPlugins ¶
func (t *Transistor) LoadPlugins() error
func (*Transistor) PluginNames ¶
func (t *Transistor) PluginNames() []string
Returns t list of strings of the configured plugins.
Click to show internal directories.
Click to hide internal directories.