Documentation ¶
Index ¶
- Variables
- type AdapterServer
- func (c *AdapterServer) CreateBinding(ctx context.Context, req *v1.CreateBindingRequest) (*v1.CreateBindingResponse, error)
- func (c *AdapterServer) DeleteBinding(ctx context.Context, req *v1.DeleteBindingRequest) (*v1.DeleteBindingResponse, error)
- func (c *AdapterServer) ListBindings(ctx context.Context, req *v1.ListBindingsRequest) (*v1.ListBindingsResponse, error)
- type BindingManager
- type BindingManagerOption
- type BindingStore
- type HealthEmitter
- type LogClient
- type MetricClient
- type Subscriber
Constants ¶
This section is empty.
Variables ¶
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 ¶
func (c *AdapterServer) CreateBinding(ctx context.Context, req *v1.CreateBindingRequest) (*v1.CreateBindingResponse, error)
CreateBinding adds a new binding to the binding manager.
func (*AdapterServer) DeleteBinding ¶
func (c *AdapterServer) DeleteBinding(ctx context.Context, req *v1.DeleteBindingRequest) (*v1.DeleteBindingResponse, error)
DeleteBinding removes a binding from the binding manager.
func (*AdapterServer) ListBindings ¶
func (c *AdapterServer) ListBindings(ctx context.Context, req *v1.ListBindingsRequest) (*v1.ListBindingsResponse, error)
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 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 ¶
Subscriber reads and writes logs for a specific binding.