Documentation ¶ Index ¶ Variables func Init(c config.Config, s micro.Service) func Run() error type Broker type Config func GetConfig() Config type Plugin type Topic Constants ¶ This section is empty. Variables ¶ View Source var ( // Broker plugins supported Plugins = map[string]func(...broker.Option) broker.Broker{ "http": http.NewBroker, "kafka": kafka.NewBroker, "nats": nats.NewBroker, "nsq": nsq.NewBroker, "rabbitmq": rabbitmq.NewBroker, } ) Functions ¶ func Init ¶ func Init(c config.Config, s micro.Service) Init initialises the config and service func Run ¶ func Run() error Run starts the federator Types ¶ type Broker ¶ type Broker map[string]Plugin Broker name:config type Config ¶ type Config struct { // name:config Topics map[string]Topic `json:"topics"` // region:config Brokers map[string]Broker `json:"brokers"` } Config is the structure we expect for Federation Config func GetConfig ¶ func GetConfig() Config type Plugin ¶ type Plugin struct { Hosts []string `json:"hosts"` } type Topic ¶ type Topic struct { // rate at which to publish Rate float64 `json:"rate"` // list of publisher regions Publish []string `json:"publish"` // list of subscriber regions Subscribe []string `json:"subscribe"` } Source Files ¶ View all Source files federation.go Click to show internal directories. Click to hide internal directories.