federation

package
v0.0.0-...-ba2e950 Latest Latest
Warning

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

Go to latest
Published: Dec 30, 2018 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

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"`
}

Jump to

Keyboard shortcuts

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