binding

package
v0.0.0-...-14308cf Latest Latest
Warning

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

Go to latest
Published: Sep 18, 2019 License: Apache-2.0 Imports: 10 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Binding

type Binding struct {
	AppID    string   `json:"app_id"`
	Drains   []string `json:"drains"`
	Hostname string   `json:"hostname"`
}

type Connector

type Connector interface {
	Connect(context.Context, syslog.Binding) (egress.Writer, error)
}

type Fetcher

type Fetcher interface {
	FetchBindings() ([]syslog.Binding, error)
	DrainLimit() int
}

type Manager

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

func NewManager

func NewManager(
	bf Fetcher,
	c Connector,
	m Metrics,
	pollingInterval time.Duration,
	idleTimeout time.Duration,
	log *log.Logger,
) *Manager

func (*Manager) GetDrains

func (m *Manager) GetDrains(sourceID string) []egress.Writer

func (*Manager) Run

func (m *Manager) Run()

type Metrics

type Metrics interface {
	NewGauge(name string, o ...metrics.MetricOption) metrics.Gauge
	NewCounter(name string, o ...metrics.MetricOption) metrics.Counter
}

type Poller

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

func NewPoller

func NewPoller(ac client, pi time.Duration, s Setter) *Poller

func (*Poller) Poll

func (p *Poller) Poll()

type Setter

type Setter interface {
	Set([]Binding)
}

type Store

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

func NewStore

func NewStore() *Store

func (*Store) Get

func (s *Store) Get() []Binding

func (*Store) Set

func (s *Store) Set(bindings []Binding)

Jump to

Keyboard shortcuts

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