v1

package
v0.0.0-...-3ce1eab 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, BSD-3-Clause, MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DataSetter

type DataSetter interface {
	Set(data []byte)
}

DataSetter accepts writes of marshalled data.

type DopplerServer

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

DopplerServer is the GRPC server component that accepts requests for firehose streams, application streams, and recent logs.

func NewDopplerServer

func NewDopplerServer(
	registrar Registrar,
	envelopeStore EnvelopeStore,
	metricClient MetricClient,
	droppedMetric *metricemitter.Counter,
	subscriptionsMetric *metricemitter.Gauge,
	health HealthRegistrar,
	batchInterval time.Duration,
	batchSize uint,
) *DopplerServer

NewDopplerServer creates a new DopplerServer.

func (*DopplerServer) Alert

func (m *DopplerServer) Alert(missed int)

Alert logs dropped message counts to stderr.

func (*DopplerServer) BatchSubscribe

BatchSubscribe is called by GRPC on stream batch requests.

func (*DopplerServer) ContainerMetrics

TODO: Deprecated

func (*DopplerServer) RecentLogs

RecentLogs is called by GRPC on recent logs requests.

func (*DopplerServer) Subscribe

Subscribe is called by GRPC on stream requests.

type EnvelopeStore

type EnvelopeStore interface {
	RecentLogsFor(appID string) []*events.Envelope
}

EnvelopeStore returns Envelopes recent logs requests.

type HealthRegistrar

type HealthRegistrar interface {
	Inc(name string)
	Dec(name string)
}

type IngestorGRPCServer

type IngestorGRPCServer interface {
	plumbing.DopplerIngestor_PusherServer
}

type IngestorServer

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

func NewIngestorServer

func NewIngestorServer(
	v1Buf *diodes.ManyToOneEnvelope,
	v2Buf *diodes.ManyToOneEnvelopeV2,
	ingressMetric *metricemitter.Counter,
	health HealthRegistrar,
) *IngestorServer

func (*IngestorServer) Pusher

type MetricClient

type MetricClient interface {
	NewCounter(name string, opts ...metricemitter.MetricOption) *metricemitter.Counter
	NewGauge(name, unit string, opts ...metricemitter.MetricOption) *metricemitter.Gauge
}

MetricClient creates new CounterMetrics to be emitted periodically.

type Registrar

type Registrar interface {
	Register(req *plumbing.SubscriptionRequest, setter DataSetter) func()
}

Registrar registers stream and firehose DataSetters to accept reads.

type Router

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

Router routes envelopes to particular buffers (called DataSetter here). In effect, the Router implements pub-sub. After a buffer has been registered with the Register method, calls to SendTo will ensure a particular envelope is sent to all registered buffers.

func NewRouter

func NewRouter() *Router

NewRouter is the constructor for Router.

func (*Router) Register

func (r *Router) Register(req *plumbing.SubscriptionRequest, dataSetter DataSetter) (cleanup func())

Register stores a request with its corresponding DataSetter. Callers should invoke the cleanup function once a registered request should no longer receive envelopes.

func (*Router) SendTo

func (r *Router) SendTo(appID string, envelope *events.Envelope)

SendTo sends an envelope for an application to all registered DataSetters.

Jump to

Keyboard shortcuts

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