mbus

package
v0.0.0-...-9b2d5d1 Latest Latest
Warning

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

Go to latest
Published: Dec 8, 2016 License: Apache-2.0, BSD-2-Clause-Views, BSD-3-Clause, + 1 more Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type RegistryMessage

type RegistryMessage struct {
	Host                    string            `json:"host"`
	Port                    uint16            `json:"port"`
	Uris                    []route.Uri       `json:"uris"`
	Tags                    map[string]string `json:"tags"`
	App                     string            `json:"app"`
	StaleThresholdInSeconds int               `json:"stale_threshold_in_seconds"`
	RouteServiceURL         string            `json:"route_service_url"`
	PrivateInstanceID       string            `json:"private_instance_id"`
	PrivateInstanceIndex    string            `json:"private_instance_index"`
}

RegistryMessage defines the format of a route registration/unregistration

func (*RegistryMessage) ValidateMessage

func (rm *RegistryMessage) ValidateMessage() bool

ValidateMessage checks to ensure the registry message is valid

type Subscriber

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

Subscriber subscribes to NATS for all router.* messages and handles them

func NewSubscriber

func NewSubscriber(
	logger lager.Logger,
	natsClient *nats.Conn,
	routeRegistry registry.RegistryInterface,
	startMsgChan <-chan struct{},
	opts *SubscriberOpts,
) *Subscriber

NewSubscriber returns a new Subscriber

func (*Subscriber) Run

func (s *Subscriber) Run(signals <-chan os.Signal, ready chan<- struct{}) error

Run manages the lifecycle of the subscriber process

type SubscriberOpts

type SubscriberOpts struct {
	ID                               string
	MinimumRegisterIntervalInSeconds int
	PruneThresholdInSeconds          int
}

SubscriberOpts contains configuration for Subscriber struct

Jump to

Keyboard shortcuts

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