egress

package
v0.0.0-...-57f4fd1 Latest Latest
Warning

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

Go to latest
Published: May 31, 2019 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Overview

Package orchestrator writes syslog drain bindings to adapters.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AdapterPool

type AdapterPool struct {
	Pool map[string]v1.AdapterClient
	// contains filtered or unexported fields
}

func NewAdapterPool

func NewAdapterPool(addrs []string, h HealthEmitter, m MetricEmitter, opts ...grpc.DialOption) AdapterPool

func (AdapterPool) Add

func (p AdapterPool) Add(ctx context.Context, adapter, task interface{}) error

func (AdapterPool) List

func (p AdapterPool) List(ctx context.Context, adapter interface{}) ([]interface{}, error)

func (AdapterPool) Remove

func (p AdapterPool) Remove(ctx context.Context, adapter, task interface{}) error

type BindingReader

type BindingReader interface {
	FetchBindings() (appBindings []v1.Binding, invalid int, err error)
}

type Communicator

type Communicator interface {
	// List returns the workload from the given adapter.
	List(ctx context.Context, adapter interface{}) ([]interface{}, error)

	// Add adds the given task to the worker. The error only logged (for now).
	// It is assumed that if the worker returns an error trying to update, the
	// next term will fix the problem and move the task elsewhere.
	Add(ctx context.Context, adapter, binding interface{}) error

	// Removes the given task from the worker. The error is only logged (for
	// now). It is assumed that if the worker is returning an error, then it
	// is either not doing the task because the worker is down, or there is a
	// network partition and a future term will fix the problem.
	Remove(ctx context.Context, adapter, binding interface{}) error
}

type HealthEmitter

type HealthEmitter interface {
	SetCounter(c map[string]int)
}

type MetricEmitter

type MetricEmitter interface {
	NewGaugeMetric(name, unit string, opts ...pulseemitter.MetricOption) pulseemitter.GaugeMetric
	NewCounterMetric(name string, opts ...pulseemitter.MetricOption) pulseemitter.CounterMetric
}

type Orchestrator

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

Orchestrator manages writes to a number of adapters.

func NewOrchestrator

func NewOrchestrator(
	adapterPool AdapterPool,
	r BindingReader,
	c Communicator,
	h HealthEmitter,
	m MetricEmitter,
) *Orchestrator

NewOrchestrator creates a new orchestrator.

func (*Orchestrator) NextTerm

func (o *Orchestrator) NextTerm()

func (*Orchestrator) Run

func (o *Orchestrator) Run(interval time.Duration)

Run starts the orchestrator.

Jump to

Keyboard shortcuts

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