Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ReadConfig

func ReadConfig(path string) (*eirini.RouteEmitterConfig, error)

Types

type Collector

type Collector interface {
	Collect() ([]Message, error)
}

type CollectorScheduler

type CollectorScheduler struct {
	Collector Collector
	Scheduler util.TaskScheduler
	Emitter   Emitter
}

func (CollectorScheduler) Start

func (c CollectorScheduler) Start()

type Emitter

type Emitter interface {
	Emit(Message)
}

func NewEmitterFromConfig

func NewEmitterFromConfig(natsIP string, natsPort int, natsPassword string, logger lager.Logger) (Emitter, error)

type Informer

type Informer interface {
	Start()
}

type Message

type Message struct {
	Routes
	Address    string
	Port       uint32
	TLSPort    uint32
	InstanceID string
	Name       string
}

type MessageEmitter

type MessageEmitter struct {
	// contains filtered or unexported fields
}

func NewMessageEmitter

func NewMessageEmitter(publisher Publisher, logger lager.Logger) MessageEmitter

func (MessageEmitter) Emit

func (e MessageEmitter) Emit(route Message)

type NATSPublisher

type NATSPublisher struct {
	NatsClient *nats.Conn
}

func (*NATSPublisher) Publish

func (p *NATSPublisher) Publish(subj string, data []byte) error

type Publisher

type Publisher interface {
	Publish(subj string, data []byte) error
}

type RegistryMessage

type RegistryMessage struct {
	Host              string   `json:"host"`
	Port              uint32   `json:"port"`
	TLSPort           uint32   `json:"tls_port,omitempty"`
	URIs              []string `json:"uris"`
	App               string   `json:"app,omitempty"`
	PrivateInstanceID string   `json:"private_instance_id"`
}

type Routes

type Routes struct {
	RegisteredRoutes   []string
	UnregisteredRoutes []string
}

Directories

Path Synopsis
Code generated by counterfeiter.
Code generated by counterfeiter.