v2

package
v0.0.0-...-a174cc8 Latest Latest
Warning

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

Go to latest
Published: Dec 30, 2024 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 CounterFilter

type CounterFilter struct {
	Name *string
}

type DataSetter

type DataSetter interface {
	Set(*loggregator_v2.Envelope)
}

DataSetter accepts writes of v2.Envelopes TODO: This could be a named function. This will be a performance bump.

type EgressServer

type EgressServer struct {
	loggregator_v2.EgressServer
	// contains filtered or unexported fields
}

EgressServer implements the loggregator_v2.EgressServer interface.

func NewEgressServer

func NewEgressServer(
	s Subscriber,
	m MetricClient,
	droppedMetric *metricemitter.Counter,
	subscriptionsMetric *metricemitter.Gauge,
	batchInterval time.Duration,
	batchSize uint,
) *EgressServer

NewEgressServer is the constructor for EgressServer.

func (*EgressServer) Alert

func (s *EgressServer) Alert(missed int)

Alert logs dropped message counts to stderr.

func (*EgressServer) BatchedReceiver

BatchedReceiver implements loggregator_v2.EgressServer.

func (*EgressServer) Receiver

Receiver implements loggregator_v2.EgressServer.

type EnvelopeFilter

type EnvelopeFilter struct {
	SourceId                 *string
	Message_Envelope_Log     *Envelope_LogFilter
	Message_Envelope_Counter *Envelope_CounterFilter
	Message_Envelope_Gauge   *Envelope_GaugeFilter
	Message_Envelope_Timer   *Envelope_TimerFilter
	Message_Envelope_Event   *Envelope_EventFilter
}

type Envelope_CounterFilter

type Envelope_CounterFilter struct {
	Counter *CounterFilter
}

type Envelope_EventFilter

type Envelope_EventFilter struct {
	Event *EventFilter
}

type Envelope_GaugeFilter

type Envelope_GaugeFilter struct {
	Gauge *GaugeFilter
}

type Envelope_LogFilter

type Envelope_LogFilter struct {
	Log *LogFilter
}

type Envelope_TimerFilter

type Envelope_TimerFilter struct {
	Timer *TimerFilter
}

type EventFilter

type EventFilter struct {
	Title *string
	Body  *string
}

type GaugeFilter

type GaugeFilter struct {
	Metrics []string
}

type IngressServer

type IngressServer struct {
	loggregator_v2.IngressServer
	// contains filtered or unexported fields
}

func NewIngressServer

func NewIngressServer(
	v1Buf *diodes.ManyToOneEnvelope,
	v2Buf *diodes.ManyToOneEnvelopeV2,
	ingressMetric *metricemitter.Counter,
) *IngressServer

func (IngressServer) BatchSender

func (IngressServer) Sender

TODO Remove the Sender method onces we are certain all Metrons are using the BatchSender method

type LogFilter

type LogFilter struct {
}

type MetricClient

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

MetricClient creates new CounterMetrics to be emitted periodically.

type PubSub

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

PubSub provides a means for callers to subscribe to envelope streams.

func NewPubSub

func NewPubSub(opts ...PubSubOption) *PubSub

NewPubSub is the constructor for PubSub.

func (*PubSub) Publish

func (p *PubSub) Publish(e *loggregator_v2.Envelope)

Publish writes an envelope to a subscriber. When there are multiple subscribers with the same shard ID, Publish will publish the envelope to only one of those subscribers.

func (*PubSub) Subscribe

func (p *PubSub) Subscribe(
	req *loggregator_v2.EgressBatchRequest,
	setter DataSetter,
) (unsubscribe func())

Subscribe associates a request with a data setter which will be invoked by future calls to Publish. A caller should invoke the returned function to unsubscribe.

type PubSubOption

type PubSubOption func(*PubSub)

PubSubOption allows for configuration of the PubSub.

func WithRand

func WithRand(int63n func(int64) int64) PubSubOption

WithRand allows for configuration of the random number generator.

type Reader

type Reader func() *loggregator_v2.Envelope

Reader reads envelopes.

type Repeater

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

Repeater connects a reader to a writer.

func NewRepeater

func NewRepeater(w Writer, r Reader) *Repeater

NewRepeater is the constructor for Repeater.

func (*Repeater) Start

func (r *Repeater) Start()

Start blocks indefinitely while transmitting data from the reader to the writer.

type Subscriber

type Subscriber interface {
	Subscribe(req *loggregator_v2.EgressBatchRequest, setter DataSetter) (unsubscribe func())
}

Subscriber registers stream DataSetters to accept reads.

type TimerFilter

type TimerFilter struct {
}

type Writer

type Writer func(*loggregator_v2.Envelope)

Writer writes envelopes.

Jump to

Keyboard shortcuts

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