subscriber

package
v0.10.3 Latest Latest
Warning

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

Go to latest
Published: Mar 9, 2016 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BalanceMode

type BalanceMode int

BalanceMode sets what balance mode to use on a subscription. valid options are currently ALL or ANY

const (
	ALL BalanceMode = iota
	ANY
)

ALL is a Balance mode option

type Config

type Config struct {
	// Whether to enable to Subscriber service
	Enabled bool `toml:"enabled"`
}

Config represents a configuration of the subscriber service.

func NewConfig

func NewConfig() Config

NewConfig returns a new instance of a subscriber config.

type PointsWriter

type PointsWriter interface {
	WritePoints(p *cluster.WritePointsRequest) error
}

PointsWriter is an interface for writing points to a subscription destination. Only WritePoints() needs to be satisfied.

type Service

type Service struct {
	MetaClient interface {
		Databases() ([]meta.DatabaseInfo, error)
		WaitForDataChanged() chan struct{}
	}
	NewPointsWriter func(u url.URL) (PointsWriter, error)
	Logger          *log.Logger
	// contains filtered or unexported fields
}

Service manages forking the incoming data from InfluxDB to defined third party destinations. Subscriptions are defined per database and retention policy.

func NewService

func NewService(c Config) *Service

NewService returns a subscriber service with given settings

func (*Service) Close

func (s *Service) Close() error

Close terminates the subscription service

func (*Service) Open

func (s *Service) Open() error

Open starts the subscription service.

func (*Service) Points

func (s *Service) Points() chan<- *cluster.WritePointsRequest

Points returns a channel into which write point requests can be sent.

func (*Service) SetLogger

func (s *Service) SetLogger(l *log.Logger)

SetLogger sets the internal logger to the logger passed in.

func (*Service) Update

func (s *Service) Update() error

Update will start new and stop deleted subscriptions.

type UDP

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

UDP supports writing points over UDP using the line protocol.

func NewUDP

func NewUDP(addr string) *UDP

NewUDP returns a new UDP listener with default options.

func (*UDP) WritePoints

func (u *UDP) WritePoints(p *cluster.WritePointsRequest) (err error)

WritePoints writes points over UDP transport.

Jump to

Keyboard shortcuts

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