context

package
v0.1.5 Latest Latest
Warning

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

Go to latest
Published: Nov 24, 2023 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ActionContext

func ActionContext(broker *nucleo.BrokerDelegates, values map[string]interface{}) nucleo.BrokerContext

ActionContext create an action context for remote call.

func BrokerContext

func BrokerContext(broker *nucleo.BrokerDelegates) nucleo.BrokerContext

func EventContext

func EventContext(broker *nucleo.BrokerDelegates, values map[string]interface{}) nucleo.BrokerContext

EventContext create an event context for a remote call.

Types

type Context

type Context struct {
	// contains filtered or unexported fields
}

func (*Context) ActionName

func (context *Context) ActionName() string

func (*Context) AsMap

func (context *Context) AsMap() map[string]interface{}

AsMap : export context info in a map[string]

func (*Context) Broadcast

func (context *Context) Broadcast(eventName string, params interface{}, groups ...string)

Broadcast : Broadcast an event for all local & remote services

func (*Context) BrokerDelegates

func (context *Context) BrokerDelegates() *nucleo.BrokerDelegates

Config return the broker config attached to this context.

func (*Context) Call

func (context *Context) Call(actionName string, params interface{}, opts ...nucleo.Options) chan nucleo.Payload

Call : main entry point to call actions. chained action invocation

func (*Context) Caller

func (context *Context) Caller() string

func (*Context) ChildActionContext

func (context *Context) ChildActionContext(actionName string, params nucleo.Payload, opts ...nucleo.Options) nucleo.BrokerContext

ChildActionContext : create a child context for a specific action call.

func (*Context) ChildEventContext

func (context *Context) ChildEventContext(eventName string, params nucleo.Payload, groups []string, broadcast bool) nucleo.BrokerContext

ChildEventContext : create a child context for a specific event call.

func (*Context) Emit

func (context *Context) Emit(eventName string, params interface{}, groups ...string)

Emit : Emit an event (grouped & balanced global event)

func (*Context) EventName

func (context *Context) EventName() string

func (*Context) Groups

func (context *Context) Groups() []string

func (*Context) ID

func (context *Context) ID() string

func (*Context) IsBroadcast

func (context *Context) IsBroadcast() bool

func (*Context) Logger

func (context *Context) Logger() *log.Entry

func (*Context) MCall

func (context *Context) MCall(callMaps map[string]map[string]interface{}) chan map[string]nucleo.Payload

func (*Context) Meta

func (context *Context) Meta() nucleo.Payload

func (*Context) Payload

func (context *Context) Payload() nucleo.Payload

func (*Context) PayloadSchema added in v0.1.4

func (context *Context) PayloadSchema() map[string]interface{}

func (*Context) Publish

func (context *Context) Publish(services ...interface{})

func (*Context) RequestID

func (context *Context) RequestID() string

func (*Context) SetPayloadSchema added in v0.1.4

func (context *Context) SetPayloadSchema(schema map[string]interface{})

func (*Context) SetTargetNodeID

func (context *Context) SetTargetNodeID(targetNodeID string)

func (*Context) SourceNodeID

func (context *Context) SourceNodeID() string

func (*Context) TargetNodeID

func (context *Context) TargetNodeID() string

func (*Context) UpdateMeta

func (context *Context) UpdateMeta(meta nucleo.Payload)

func (*Context) WaitFor

func (context *Context) WaitFor(services ...string) error

Jump to

Keyboard shortcuts

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