Documentation ¶
Index ¶
- Variables
- func ComposeKey(label string, id int64) string
- func RandStringBytes(n int) string
- type BaseDescriptor
- func (p *BaseDescriptor) EventGroup() goka.Group
- func (p *BaseDescriptor) EventInputStream() goka.Stream
- func (p *BaseDescriptor) EventOutputStream() goka.Stream
- func (p *BaseDescriptor) HubGroup() goka.Group
- func (p *BaseDescriptor) HubInputStream() goka.Stream
- func (p *BaseDescriptor) HubOutputStream() goka.Stream
- func (p *BaseDescriptor) Label() string
- type ChainHandledState
- type ChangeInfo
- type ChangeInfos
- type ContextDefinition
- type CypherQuery
- type DispatcherFunc
- type EntityContext
- type EntityDescriptor
- type ErrorHandler
- type ErrorHandlers
- type EvalFunc
- type EvalFuncs
- type EventContext
- type EventContextCodec
- type Executor
- func (p *Executor) ApplyProperties(nodeID int64, ctx Properties) error
- func (p *Executor) BuildEntityContext(nodeID int64) (*EntityContext, error)
- func (p *Executor) NotifySuperOrdinates(sender string, senderID int64, operation Operation, props Properties) error
- func (p *Executor) Run(cypher CypherQuery, ctx Properties, onRecord OnRecordFunc) error
- type Handler
- type HandlerContext
- type Handlers
- type HubContext
- type HubContextCodec
- type Matcher
- type MatcherFunc
- type OnRecordFunc
- type Operation
- type Operations
- type Properties
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrEmptyOperationResult = errors.New("empty operation result") ErrInvalidOperationResult = errors.New("invalid operation result") )
View Source
var ( CreatedOperation = Operation("created") UpdatedOperation = Operation("updated") DeletedOperation = Operation("deleted") )
View Source
var ( HubStream = goka.Stream("Hub") // Hubmessages Entity-> Hub HubGroup = goka.Group("Hub") // Hubmessages Entity-> Hub InputGroup = goka.Group("Input") // Neo4jMessages -> Incoming )
View Source
var (
Neo4jDriver neo4j.Driver
)
Functions ¶
func ComposeKey ¶
func RandStringBytes ¶
Types ¶
type BaseDescriptor ¶
type BaseDescriptor struct {
// contains filtered or unexported fields
}
func NewBaseDescriptor ¶
func NewBaseDescriptor(label string) *BaseDescriptor
func (*BaseDescriptor) EventGroup ¶
func (p *BaseDescriptor) EventGroup() goka.Group
func (*BaseDescriptor) EventInputStream ¶
func (p *BaseDescriptor) EventInputStream() goka.Stream
func (*BaseDescriptor) EventOutputStream ¶
func (p *BaseDescriptor) EventOutputStream() goka.Stream
func (*BaseDescriptor) HubGroup ¶
func (p *BaseDescriptor) HubGroup() goka.Group
func (*BaseDescriptor) HubInputStream ¶
func (p *BaseDescriptor) HubInputStream() goka.Stream
func (*BaseDescriptor) HubOutputStream ¶
func (p *BaseDescriptor) HubOutputStream() goka.Stream
func (*BaseDescriptor) Label ¶
func (p *BaseDescriptor) Label() string
type ChainHandledState ¶
type ChainHandledState int
const ( ChainHandledStateThenFailed ChainHandledState = iota ChainHandledStateElseFailed ChainHandledStateUnhandled ChainHandledStateThen ChainHandledStateElse )
func (ChainHandledState) Failed ¶
func (p ChainHandledState) Failed() bool
func (ChainHandledState) String ¶
func (i ChainHandledState) String() string
type ChangeInfo ¶
type ChangeInfo struct { Before interface{} `json:"before"` After interface{} `json:"after"` }
func (ChangeInfo) Created ¶
func (p ChangeInfo) Created() bool
func (ChangeInfo) Deleted ¶
func (p ChangeInfo) Deleted() bool
func (ChangeInfo) Updated ¶
func (p ChangeInfo) Updated() bool
type ChangeInfos ¶
type ChangeInfos map[string]ChangeInfo
func (ChangeInfos) Created ¶
func (p ChangeInfos) Created(field string) bool
func (ChangeInfos) Deleted ¶
func (p ChangeInfos) Deleted(field string) bool
func (ChangeInfos) Updated ¶
func (p ChangeInfos) Updated(field string) bool
type ContextDefinition ¶
type ContextDefinition map[string]CypherQuery
type CypherQuery ¶
type CypherQuery string
func (CypherQuery) String ¶
func (p CypherQuery) String() string
type DispatcherFunc ¶
type EntityContext ¶
type EntityContext struct { NodeID int64 Context map[string]Properties }
func (*EntityContext) Append ¶
func (p *EntityContext) Append(key string, prop Properties)
type EntityDescriptor ¶
type ErrorHandler ¶
type ErrorHandler func(err error)
type ErrorHandlers ¶
type ErrorHandlers []ErrorHandler
type EventContext ¶
type EventContext struct { TimeStamp time.Time `json:"time_stamp"` Operation Operation `json:"operation"` NodeID int64 `json:"node_id"` ChangeInfos ChangeInfos `json:"change_infos"` Properties Properties `json:"properties"` }
func (*EventContext) BuildChanges ¶
func (p *EventContext) BuildChanges(before bool, props map[string]interface{})
type EventContextCodec ¶
type EventContextCodec struct{}
func (*EventContextCodec) Decode ¶
func (p *EventContextCodec) Decode(data []byte) (interface{}, error)
func (*EventContextCodec) Encode ¶
func (p *EventContextCodec) Encode(value interface{}) ([]byte, error)
type Executor ¶
type Executor struct {
*HandlerContext
}
func NewExecutor ¶
func NewExecutor(ctx *HandlerContext) *Executor
func (*Executor) ApplyProperties ¶
func (p *Executor) ApplyProperties(nodeID int64, ctx Properties) error
func (*Executor) BuildEntityContext ¶
func (p *Executor) BuildEntityContext(nodeID int64) (*EntityContext, error)
func (*Executor) NotifySuperOrdinates ¶
func (*Executor) Run ¶
func (p *Executor) Run(cypher CypherQuery, ctx Properties, onRecord OnRecordFunc) error
type Handler ¶
type Handler func(ctx *HandlerContext) error
type HandlerContext ¶
type HandlerContext struct { GokaContext goka.Context EntityDescriptor EntityDescriptor EventContext *EventContext HubContext *HubContext // contains filtered or unexported fields }
func (*HandlerContext) Get ¶
func (p *HandlerContext) Get(key string) interface{}
func (*HandlerContext) GetEntityContext ¶
func (p *HandlerContext) GetEntityContext() *EntityContext
func (*HandlerContext) Set ¶
func (p *HandlerContext) Set(key string, value interface{})
type HubContext ¶
type HubContextCodec ¶
type HubContextCodec struct{}
func (*HubContextCodec) Decode ¶
func (p *HubContextCodec) Decode(data []byte) (interface{}, error)
func (*HubContextCodec) Encode ¶
func (p *HubContextCodec) Encode(value interface{}) ([]byte, error)
type Matcher ¶
type Matcher struct {
// contains filtered or unexported fields
}
func NewMatcher ¶
func NewMatcher(fns ...MatcherFunc) *Matcher
type MatcherFunc ¶
func MatchConditions ¶
func MatchConditions(conditions ...EvalFunc) MatcherFunc
type OnRecordFunc ¶
type Operations ¶
type Operations []Operation
type Properties ¶
type Properties map[string]interface{}
func (Properties) MustBool ¶
func (p Properties) MustBool(field string) bool
func (Properties) MustGet ¶
func (p Properties) MustGet(field string) interface{}
func (Properties) MustInt64 ¶
func (p Properties) MustInt64(field string) int64
func (Properties) MustString ¶
func (p Properties) MustString(field string) string
Click to show internal directories.
Click to hide internal directories.