binding

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: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrMaxBindingsExceeded = errors.New("Max bindings for adapter exceeded")
)

Functions

This section is empty.

Types

type AdapterServer

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

AdapterServer implements the v1.AdapterServer interface.

func NewAdapterServer

func NewAdapterServer(store BindingStore, health HealthEmitter) *AdapterServer

New returns a new AdapterServer.

func (*AdapterServer) CreateBinding

CreateBinding adds a new binding to the binding manager.

func (*AdapterServer) DeleteBinding

DeleteBinding removes a binding from the binding manager.

func (*AdapterServer) ListBindings

ListBindings returns a list of bindings from the binding manager

type BindingManager

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

BindingManager stores binding subscriptions.

func NewBindingManager

func NewBindingManager(
	s Subscriber,
	mc MetricClient,
	lc LogClient,
	sourceIndex string,
	opts ...BindingManagerOption,
) *BindingManager

New returns a new Binding Manager.

func (*BindingManager) Add

func (c *BindingManager) Add(binding *v1.Binding) error

Add stores a new binding subscription to the Binding Manager.

func (*BindingManager) Delete

func (c *BindingManager) Delete(binding *v1.Binding)

Delete removes a binding subscription from the Binding Manager. It also unsubscribes the binding subscription. If the binding does not exist it is a nop.

func (*BindingManager) List

func (c *BindingManager) List() []*v1.Binding

List returns a list of all the bindings in the Binding Manager.

type BindingManagerOption

type BindingManagerOption func(*BindingManager)

BindingManagerOption is a function that can be used to configure optional settings on a BindingManager.

func WithMaxBindings

func WithMaxBindings(max int) BindingManagerOption

WithMaxBindings sets the maximum number of allowed bindings.

type BindingStore

type BindingStore interface {
	Add(binding *v1.Binding) error
	Delete(binding *v1.Binding)
	List() (bindings []*v1.Binding)
}

BindingStore manages the bindings and respective subscriptions

type HealthEmitter

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

type LogClient

type LogClient interface {
	EmitLog(message string, opts ...loggregator.EmitLogOption)
}

LogClient is used to emit logs.

type MetricClient

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

MetricClient is used to emit metrics.

type Subscriber

type Subscriber interface {
	Start(binding *v1.Binding) (stopFunc func())
}

Subscriber reads and writes logs for a specific binding.

Jump to

Keyboard shortcuts

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