service

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: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MergeSettings

func MergeSettings(settings ...map[string]interface{}) map[string]interface{}

Types

type Action

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

func CreateServiceAction

func CreateServiceAction(serviceName string, actionName string, handler moleculer.ActionHandler, params moleculer.ActionSchema) Action

func (*Action) FullName

func (serviceAction *Action) FullName() string

func (*Action) Handler

func (serviceAction *Action) Handler() moleculer.ActionHandler

func (*Action) Name

func (serviceAction *Action) Name() string

type Event

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

func CreateServiceEvent

func CreateServiceEvent(eventName, serviceName, group string, handler moleculer.EventHandler) Event

func (*Event) Group

func (event *Event) Group() string

func (*Event) Handler

func (event *Event) Handler() moleculer.EventHandler

func (*Event) Name

func (event *Event) Name() string

func (*Event) ServiceName

func (event *Event) ServiceName() string

type HasCreated

type HasCreated interface {
	Created(moleculer.ServiceSchema, *log.Entry)
}

type HasCreatedNoParams

type HasCreatedNoParams interface {
	Created()
}

type HasDependencies

type HasDependencies interface {
	Dependencies() []string
}

type HasEvents

type HasEvents interface {
	Events() []moleculer.Event
}

type HasMetadata

type HasMetadata interface {
	Metadata() map[string]interface{}
}

type HasMixins

type HasMixins interface {
	Mixins() []moleculer.Mixin
}

type HasName

type HasName interface {
	Name() string
}

type HasSettings

type HasSettings interface {
	Settings() map[string]interface{}
}

type HasStarted

type HasStarted interface {
	Started(moleculer.BrokerContext, moleculer.ServiceSchema)
}

type HasStartedNoParams

type HasStartedNoParams interface {
	Started()
}

type HasStopped

type HasStopped interface {
	Stopped(moleculer.BrokerContext, moleculer.ServiceSchema)
}

type HasStoppedNoParams

type HasStoppedNoParams interface {
	Stopped()
}

type HasVersion

type HasVersion interface {
	Version() string
}

type Service

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

func CreateServiceFromMap

func CreateServiceFromMap(serviceInfo map[string]interface{}) *Service

func FromObject

func FromObject(obj interface{}, bkr *moleculer.BrokerDelegates) (*Service, error)

FromObject creates a service based on an object.

func FromSchema

func FromSchema(schema moleculer.ServiceSchema, bkr *moleculer.BrokerDelegates) *Service

func (*Service) Actions

func (service *Service) Actions() []Action

func (*Service) AddActionMap

func (service *Service) AddActionMap(actionInfo map[string]interface{}) *Action

func (*Service) AddEventMap

func (service *Service) AddEventMap(eventInfo map[string]interface{}) *Event

func (*Service) AsMap

func (service *Service) AsMap() map[string]interface{}

AsMap export the service info in a map containing: name, version, settings, metadata, nodeID, actions and events. The events list does not contain internal events (events that starts with $) like $node.disconnected.

func (*Service) Dependencies

func (service *Service) Dependencies() []string

func (*Service) Events

func (service *Service) Events() []Event

func (*Service) FullName

func (service *Service) FullName() string

func (*Service) Name

func (service *Service) Name() string

func (*Service) NodeID

func (service *Service) NodeID() string

func (*Service) RemoveAction

func (service *Service) RemoveAction(fullname string)

func (*Service) RemoveEvent

func (service *Service) RemoveEvent(name string)

func (*Service) Schema

func (service *Service) Schema() *moleculer.ServiceSchema

func (*Service) SetNodeID

func (service *Service) SetNodeID(nodeID string)

func (*Service) Settings

func (service *Service) Settings() map[string]interface{}

func (*Service) Start

func (service *Service) Start(context moleculer.BrokerContext)

Start called by the broker when the service is starting.

func (*Service) Stop

func (service *Service) Stop(context moleculer.BrokerContext)

Stop called by the broker when the service is stopping.

func (*Service) Summary

func (service *Service) Summary() map[string]string

func (*Service) UpdateFromMap

func (service *Service) UpdateFromMap(serviceInfo map[string]interface{})

func (*Service) Version

func (service *Service) Version() string

Jump to

Keyboard shortcuts

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