Documentation ¶
Index ¶
- func JoinVersionToName(name string, version string) string
- func MergeSettings(settings ...map[string]interface{}) map[string]interface{}
- func ParseVersion(iver interface{}) string
- type Action
- type Event
- type HasCreated
- type HasCreatedNoParams
- type HasDependencies
- type HasEvents
- type HasMetadata
- type HasMixins
- type HasName
- type HasSettings
- type HasStarted
- type HasStartedNoParams
- type HasStopped
- type HasStoppedNoParams
- type HasVersion
- type Service
- func (service *Service) Actions() []Action
- func (service *Service) AddActionMap(actionInfo map[string]interface{}) *Action
- func (service *Service) AddEventMap(eventInfo map[string]interface{}) *Event
- func (service *Service) AddMetadata(metadata map[string]interface{})
- func (service *Service) AddSettings(settings map[string]interface{})
- func (service *Service) AsMap() map[string]interface{}
- func (service *Service) Dependencies() []string
- func (service *Service) Events() []Event
- func (service *Service) FullName() string
- func (service *Service) Name() string
- func (service *Service) NodeID() string
- func (service *Service) RemoveAction(fullname string)
- func (service *Service) RemoveEvent(name string)
- func (service *Service) Schema() *nucleo.ServiceSchema
- func (service *Service) SetNodeID(nodeID string)
- func (service *Service) Settings() map[string]interface{}
- func (service *Service) Start(context nucleo.BrokerContext)
- func (service *Service) Stop(context nucleo.BrokerContext)
- func (service *Service) Summary() map[string]string
- func (service *Service) UpdateFromMap(serviceInfo map[string]interface{})
- func (service *Service) Version() string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func JoinVersionToName ¶
func MergeSettings ¶
func ParseVersion ¶
func ParseVersion(iver interface{}) string
Types ¶
type Action ¶
type Action struct {
// contains filtered or unexported fields
}
func CreateServiceAction ¶
type Event ¶
type Event struct {
// contains filtered or unexported fields
}
func CreateServiceEvent ¶
func (*Event) ServiceName ¶
type HasCreated ¶
type HasCreatedNoParams ¶
type HasCreatedNoParams interface {
Created()
}
type HasDependencies ¶
type HasDependencies interface {
Dependencies() []string
}
type HasMetadata ¶
type HasMetadata interface {
Metadata() map[string]interface{}
}
type HasSettings ¶
type HasSettings interface {
Settings() map[string]interface{}
}
type HasStarted ¶
type HasStarted interface {
Started(nucleo.BrokerContext, nucleo.ServiceSchema)
}
type HasStartedNoParams ¶
type HasStartedNoParams interface {
Started()
}
type HasStopped ¶
type HasStopped interface {
Stopped(nucleo.BrokerContext, nucleo.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 FromObject ¶
FromObject creates a service based on an object.
func FromSchema ¶
func FromSchema(schema nucleo.ServiceSchema, bkr *nucleo.BrokerDelegates) *Service
func (*Service) AddActionMap ¶
func (*Service) AddEventMap ¶
func (*Service) AddMetadata ¶
AddMetadata add metadata to the service. it will be merged with existing service metadata.
func (*Service) AddSettings ¶
AddSettings add settings to the service. it will be merged with the existing service settings
func (*Service) AsMap ¶
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) RemoveAction ¶
func (*Service) RemoveEvent ¶
func (*Service) Start ¶
func (service *Service) Start(context nucleo.BrokerContext)
Start called by the broker when the service is starting.
func (*Service) Stop ¶
func (service *Service) Stop(context nucleo.BrokerContext)
Stop called by the broker when the service is stopping.
func (*Service) UpdateFromMap ¶
UpdateFromMap update the service metadata and settings from a serviceInfo map
Click to show internal directories.
Click to hide internal directories.