github.com/moleculer-go/moleculer@v0.3.3/registry/common_test.go (about) 1 package registry_test 2 3 import ( 4 . "github.com/moleculer-go/goemitter" 5 "github.com/moleculer-go/moleculer" 6 "github.com/moleculer-go/moleculer/registry" 7 8 log "github.com/sirupsen/logrus" 9 ) 10 11 var logger = log.WithField("unit test pkg", "registry_test") 12 13 func CreateLogger(name string, value string) *log.Entry { 14 return logger.WithField(name, value) 15 } 16 17 func BrokerDelegates(nodeID string) *moleculer.BrokerDelegates { 18 localBus := Construct() 19 localNode := registry.CreateNode(nodeID, true, logger) 20 broker := &moleculer.BrokerDelegates{ 21 LocalNode: func() moleculer.Node { 22 return localNode 23 }, 24 Logger: CreateLogger, 25 Bus: func() *Emitter { 26 return localBus 27 }} 28 return broker 29 }