context

package
v0.2.3 Latest Latest
Warning

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

Go to latest
Published: Mar 10, 2020 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ActionContext

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

ActionContext create an action context for remote call.

func EventContext

func EventContext(broker *moleculer.BrokerDelegates, values map[string]interface{}) moleculer.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() *moleculer.BrokerDelegates

Config return the broker config attached to this context.

func (*Context) Call

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

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

func (*Context) ChildActionContext

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

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

func (*Context) ChildEventContext

func (context *Context) ChildEventContext(eventName string, params moleculer.Payload, groups []string, broadcast bool) moleculer.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]moleculer.Payload

func (*Context) Meta

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

func (*Context) Payload

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

func (*Context) Publish

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

func (*Context) RequestID

func (context *Context) RequestID() string

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 moleculer.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