broker

package
v0.0.6 Latest Latest
Warning

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

Go to latest
Published: Feb 28, 2024 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ServiceBroker

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

func New

func New(userConfig ...*moleculer.Config) *ServiceBroker

New : returns a valid broker based on environment configuration this is usually called when creating a broker to starting the service(s)

func (*ServiceBroker) Broadcast

func (broker *ServiceBroker) Broadcast(event string, params interface{}, groups ...string)

func (*ServiceBroker) Call

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

Call : invoke a service action and return a channel which will eventualy deliver the results ;)

func (*ServiceBroker) Emit

func (broker *ServiceBroker) Emit(event string, params interface{}, groups ...string)

func (*ServiceBroker) GetLogger

func (broker *ServiceBroker) GetLogger(name string, value string) *log.Entry

func (*ServiceBroker) IsStarted

func (broker *ServiceBroker) IsStarted() bool

func (*ServiceBroker) KnowAction

func (broker *ServiceBroker) KnowAction(action string) bool

func (*ServiceBroker) LocalBus

func (broker *ServiceBroker) LocalBus() *bus.Emitter

GetLocalBus : return the service broker local bus (Event Emitter)

func (*ServiceBroker) LocalNode

func (broker *ServiceBroker) LocalNode() moleculer.Node

func (*ServiceBroker) MCall

func (broker *ServiceBroker) MCall(callMaps map[string]map[string]interface{}) chan map[string]moleculer.Payload

MCall perform multiple calls and return all results together in a nice map indexed by name.

func (*ServiceBroker) Publish

func (broker *ServiceBroker) Publish(services ...interface{})

Publish : for each service schema it will validate and create a service instance in the broker.

func (*ServiceBroker) Start

func (broker *ServiceBroker) Start()

func (*ServiceBroker) Stop

func (broker *ServiceBroker) Stop()

func (*ServiceBroker) WaitFor

func (broker *ServiceBroker) WaitFor(services ...string) error

WaitFor : wait for all services to be available

func (*ServiceBroker) WaitForActions

func (broker *ServiceBroker) WaitForActions(actions ...string) error

WaitForActions : wait for all actions to be available

func (*ServiceBroker) WaitForNodes

func (broker *ServiceBroker) WaitForNodes(nodes ...string) error

WaitForNodes : wait for all nodes to be available

Jump to

Keyboard shortcuts

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