mbus

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Mar 27, 2018 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AddressTable

type AddressTable interface {
	Add(infraNames []string, ip string)
	Remove(infraNames []string, ip string)
	PausePruning()
	ResumePruning()
	SetWarm()
}

type NatsConn

type NatsConn interface {
	PublishMsg(m *nats.Msg) error
	Close()
	Flush() error
	ConnectedUrl() string
	Subscribe(string, nats.MsgHandler) (*nats.Subscription, error)
}

type NatsConnProvider

type NatsConnProvider interface {
	Connection(opts ...nats.Option) (NatsConn, error)
}

type NatsConnWithUrlProvider

type NatsConnWithUrlProvider struct {
	Url string
}

func (*NatsConnWithUrlProvider) Connection

func (p *NatsConnWithUrlProvider) Connection(opts ...nats.Option) (NatsConn, error)

type RegistryMessage

type RegistryMessage struct {
	IP         string   `json:"host"`
	InfraNames []string `json:"uris"`
}

type ServiceDiscoveryStartMessage

type ServiceDiscoveryStartMessage struct {
	Id                               string `json:"id"`
	Host                             string `json:"host"`
	MinimumRegisterIntervalInSeconds int    `json:"minimumRegisterIntervalInSeconds"`
	PruneThresholdInSeconds          int    `json:"pruneThresholdInSeconds"`
}

type Subscriber

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

func NewSubscriber

func NewSubscriber(
	natsConnProvider NatsConnProvider,
	subOpts SubscriberOpts,
	warmingDuration time.Duration,
	table AddressTable,
	localIP string,
	logger lager.Logger,
	metricsSender metricsSender,
	clock clock.Clock,
) *Subscriber

func (*Subscriber) Close

func (s *Subscriber) Close()

func (*Subscriber) Run

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

func (*Subscriber) RunOnce

func (s *Subscriber) RunOnce() error

type SubscriberOpts

type SubscriberOpts struct {
	ID                               string
	MinimumRegisterIntervalInSeconds int
	PruneThresholdInSeconds          int
	AcceptTLS                        bool
}

Directories

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

Jump to

Keyboard shortcuts

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