test

package
v0.0.7 Latest Latest
Warning

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

Go to latest
Published: Mar 11, 2024 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var CounterCheckTimeout = 10 * time.Second

Functions

func DelegatesWithId

func DelegatesWithId(nodeID string) *moleculer.BrokerDelegates

func DelegatesWithIdAndConfig

func DelegatesWithIdAndConfig(nodeID string, config moleculer.Config) *moleculer.BrokerDelegates

func Logger

func Logger(name string, value string) *log.Entry

func OrderMapArray

func OrderMapArray(list []map[string]interface{}, field string) []map[string]interface{}

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) Check

func (counter *CounterCheck) Check(name string, value int) error

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
}

func (*NodeMock) Available

func (node *NodeMock) Available()

func (*NodeMock) ExportAsMap

func (node *NodeMock) ExportAsMap() map[string]interface{}

func (*NodeMock) GetID

func (node *NodeMock) GetID() string

func (*NodeMock) HeartBeat

func (node *NodeMock) HeartBeat(heartbeat map[string]interface{})

func (*NodeMock) IncreaseSequence

func (node *NodeMock) IncreaseSequence()

func (*NodeMock) IsAvailable

func (node *NodeMock) IsAvailable() bool

func (*NodeMock) IsExpired

func (node *NodeMock) IsExpired(timeout time.Duration) bool

func (*NodeMock) Publish

func (node *NodeMock) Publish(service map[string]interface{})

func (*NodeMock) Unavailable

func (node *NodeMock) Unavailable()

func (*NodeMock) Update

func (node *NodeMock) Update(id string, info map[string]interface{}) bool

Jump to

Keyboard shortcuts

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