event

package
v0.0.0-...-8923af6 Latest Latest
Warning

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

Go to latest
Published: Mar 13, 2019 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateConsumer

func CreateConsumer(group goka.Group, inputStream, outputStream goka.Stream, execs ...Executable) shared.DispatcherFunc

func CreateConsumerDefaults

func CreateConsumerDefaults(descr shared.EntityDescriptor, execs ...Executable) shared.DispatcherFunc

receives input messages, sends hub messages

func LoadEntityContext

func LoadEntityContext() shared.Handler

func NotifySuperOrdinates

func NotifySuperOrdinates() shared.Handler

Types

type ActionData

type ActionData struct {
	EntityDescriptor shared.EntityDescriptor
	Operation        shared.Operation
	FieldOperation   shared.Operation
	ErrorHandlers    shared.ErrorHandlers
	Then             shared.Handlers
	Else             shared.Handlers
	Conditions       shared.EvalFuncs
	FieldName        string
	Or               []ActionData
	And              []ActionData
	Not              []ActionData
}

func (*ActionData) Match

func (p *ActionData) Match(m *shared.EventContext) bool

type Alternative

type Alternative interface {
	Else(fns ...shared.Handler) Catchable
	Catch(fn shared.ErrorHandler) Executable
}

type Catchable

type Catchable interface {
	Catch(fn shared.ErrorHandler) Executable
}

type Combinable

type Combinable interface {
	Or(or ...Combinable) Combinable
	And(or ...Combinable) Combinable
	Not(not ...Combinable) Combinable
}

func OnFieldCreated

func OnFieldCreated(field string) Combinable

func OnFieldDeleted

func OnFieldDeleted(field string) Combinable

func OnFieldUpdated

func OnFieldUpdated(field string) Combinable

func OnNodeCreated

func OnNodeCreated() Combinable

func OnNodeDeleted

func OnNodeDeleted() Combinable

func OnNodeUpdated

func OnNodeUpdated() Combinable

type Executable

type Executable interface {
	Execute(ctx goka.Context, m *shared.EventContext) shared.ChainHandledState
	SetDescriptor(descr shared.EntityDescriptor) Executable
}

type Neo4jBeforeOrAfter

type Neo4jBeforeOrAfter struct {
	Labels     []string          `json:"labels"`
	Properties shared.Properties `json:"properties"`
}

type Neo4jMessage

type Neo4jMessage struct {
	Meta    Neo4jMeta    `json:"meta"`
	Payload Neo4jPayload `json:"payload"`
}

func (*Neo4jMessage) ToContext

func (p *Neo4jMessage) ToContext() (*shared.EventContext, error)

type Neo4jMessageCodec

type Neo4jMessageCodec struct{}

func (*Neo4jMessageCodec) Decode

func (p *Neo4jMessageCodec) Decode(data []byte) (interface{}, error)

func (*Neo4jMessageCodec) Encode

func (p *Neo4jMessageCodec) Encode(value interface{}) ([]byte, error)

type Neo4jMeta

type Neo4jMeta struct {
	Timestamp     int64            `json:"timestamp"`
	Username      string           `json:"username"`
	TxID          int              `json:"tx_id"`
	TxEventID     int              `json:"tx_event_id"`
	TxEventsCount int              `json:"tx_events_count"`
	Operation     shared.Operation `json:"operation"`
	Source        Neo4jSource      `json:"source"`
}

type Neo4jPayload

type Neo4jPayload struct {
	ID       string              `json:"id"`
	Type     string              `json:"type"`
	RelLabel string              `json:"label"`
	Start    *Neo4jStartOrEnd    `json:"start,omitempty"`
	End      *Neo4jStartOrEnd    `json:"end,omitempty"`
	After    *Neo4jBeforeOrAfter `json:"after,omitempty"`
	Before   *Neo4jBeforeOrAfter `json:"before,omitempty"`
}

type Neo4jSource

type Neo4jSource struct {
	Hostname string `json:"hostname"`
}

type Neo4jStartOrEnd

type Neo4jStartOrEnd struct {
	Labels []string `json:"labels"`
	ID     string   `json:"id"`
}

type Proceedable

type Proceedable interface {
	Then(fns ...shared.Handler) Alternative
}

func If

func If(comb Combinable) Proceedable

type Selectable

type Selectable interface {
	OnNodeCreated() Combinable
	OnNodeUpdated() Combinable
	OnNodeDeleted() Combinable
	OnFieldCreated(field string) Combinable
	OnFieldUpdated(field string) Combinable
	OnFieldDeleted(field string) Combinable
	With(fn shared.EvalFunc) Combinable
}

Jump to

Keyboard shortcuts

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