broker

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: 15 Imported by: 1

README

Broker

This is where the whole framework starts from.

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 ...*nucleo.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 ...nucleo.Options) chan nucleo.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() nucleo.Node

func (*ServiceBroker) MCall

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

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

func (*ServiceBroker) PublishServices

func (broker *ServiceBroker) PublishServices(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