Documentation
¶
Index ¶
- Variables
- func DelegatesWithId(nodeID string) *moleculer.BrokerDelegates
- func DelegatesWithIdAndConfig(nodeID string, config moleculer.Config) *moleculer.BrokerDelegates
- func Logger(name string, value string) *log.Entry
- func OrderMapArray(list []map[string]interface{}, field string) []map[string]interface{}
- type CounterCheck
- type NodeMock
- func (node *NodeMock) Available()
- func (node *NodeMock) ExportAsMap() map[string]interface{}
- func (node *NodeMock) GetCpu() int64
- func (node *NodeMock) GetCpuSequence() int64
- func (node *NodeMock) GetHost() string
- func (node *NodeMock) GetHostname() string
- func (node *NodeMock) GetID() string
- func (node *NodeMock) GetIpList() []string
- func (node *NodeMock) GetPort() int
- func (node *NodeMock) GetSequence() int64
- func (node *NodeMock) GetUdpAddress() string
- func (node *NodeMock) HeartBeat(heartbeat map[string]interface{})
- func (node *NodeMock) IncreaseSequence()
- func (node *NodeMock) IsAvailable() bool
- func (node *NodeMock) IsExpired(timeout time.Duration) bool
- func (node *NodeMock) IsLocal() bool
- func (node *NodeMock) Publish(service map[string]interface{})
- func (node *NodeMock) Unavailable()
- func (node *NodeMock) Update(id string, info map[string]interface{}) (bool, []map[string]interface{})
- func (node *NodeMock) UpdateInfo(info map[string]interface{}) []map[string]interface{}
- func (node *NodeMock) UpdateMetrics()
- type RegistryMock
- func (r *RegistryMock) AddOfflineNode(nodeID, hostname, ipAddress string, port int) moleculer.Node
- func (r *RegistryMock) DisconnectNode(nodeID string)
- func (r *RegistryMock) ForEachNode(fn moleculer.ForEachNodeFunc)
- func (r *RegistryMock) GetLocalNode() moleculer.Node
- func (r *RegistryMock) GetNodeByAddress(host string) moleculer.Node
- func (r *RegistryMock) GetNodeByID(nodeID string) moleculer.Node
- func (r *RegistryMock) RemoteNodeInfoReceived(message moleculer.Payload)
Constants ¶
This section is empty.
Variables ¶
View Source
var CounterCheckTimeout = 20 * time.Second
Functions ¶
func DelegatesWithId ¶
func DelegatesWithId(nodeID string) *moleculer.BrokerDelegates
func DelegatesWithIdAndConfig ¶
func DelegatesWithIdAndConfig(nodeID string, config moleculer.Config) *moleculer.BrokerDelegates
func OrderMapArray ¶
OrderMapArray given an array of map[string]... this func will order based on the field name.
Types ¶
type CounterCheck ¶
type CounterCheck struct {
// contains filtered or unexported fields
}
func Counter ¶
func Counter() CounterCheck
func (*CounterCheck) CheckPrefixed ¶
func (counter *CounterCheck) CheckPrefixed(name string, value int) error
func (*CounterCheck) Clear ¶
func (counter *CounterCheck) Clear()
func (*CounterCheck) Inc ¶
func (counter *CounterCheck) Inc(nodeID string, name string)
type NodeMock ¶
type NodeMock struct {
UpdateResult bool
ID string
IncreaseSequenceCalls int
HeartBeatCalls int
ExportAsMapResult map[string]interface{}
IsAvailableResult bool
IsExpiredResult bool
PublishCalls int
// Additional fields for missing methods
Host string
IpList []string
Port int
UdpAddress string
Sequence int64
CpuSequence int64
Cpu int64
IsLocalFlag bool
Hostname string
}
func (*NodeMock) ExportAsMap ¶
func (*NodeMock) GetCpuSequence ¶ added in v0.3.7
func (*NodeMock) GetHostname ¶ added in v0.3.7
func (*NodeMock) GetSequence ¶ added in v0.3.7
func (*NodeMock) GetUdpAddress ¶ added in v0.3.7
func (*NodeMock) IncreaseSequence ¶
func (node *NodeMock) IncreaseSequence()
func (*NodeMock) IsAvailable ¶
func (*NodeMock) Unavailable ¶
func (node *NodeMock) Unavailable()
func (*NodeMock) UpdateInfo ¶ added in v0.3.7
func (*NodeMock) UpdateMetrics ¶ added in v0.3.7
func (node *NodeMock) UpdateMetrics()
type RegistryMock ¶ added in v0.3.7
RegistryMock implements moleculer.Registry interface for testing
func (*RegistryMock) AddOfflineNode ¶ added in v0.3.7
func (r *RegistryMock) AddOfflineNode(nodeID, hostname, ipAddress string, port int) moleculer.Node
func (*RegistryMock) DisconnectNode ¶ added in v0.3.7
func (r *RegistryMock) DisconnectNode(nodeID string)
func (*RegistryMock) ForEachNode ¶ added in v0.3.7
func (r *RegistryMock) ForEachNode(fn moleculer.ForEachNodeFunc)
func (*RegistryMock) GetLocalNode ¶ added in v0.3.7
func (r *RegistryMock) GetLocalNode() moleculer.Node
func (*RegistryMock) GetNodeByAddress ¶ added in v0.3.7
func (r *RegistryMock) GetNodeByAddress(host string) moleculer.Node
func (*RegistryMock) GetNodeByID ¶ added in v0.3.7
func (r *RegistryMock) GetNodeByID(nodeID string) moleculer.Node
func (*RegistryMock) RemoteNodeInfoReceived ¶ added in v0.3.7
func (r *RegistryMock) RemoteNodeInfoReceived(message moleculer.Payload)
Click to show internal directories.
Click to hide internal directories.