Documentation ¶
Index ¶
- type CounterFilter
- type DataSetter
- type EgressServer
- type EnvelopeFilter
- type Envelope_CounterFilter
- type Envelope_EventFilter
- type Envelope_GaugeFilter
- type Envelope_LogFilter
- type Envelope_TimerFilter
- type EventFilter
- type GaugeFilter
- type IngressServer
- type LogFilter
- type MetricClient
- type PubSub
- type PubSubOption
- type Reader
- type Repeater
- type Subscriber
- type TimerFilter
- type Writer
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 ¶
func (s *EgressServer) BatchedReceiver( req *loggregator_v2.EgressBatchRequest, sender loggregator_v2.Egress_BatchedReceiverServer, ) error
BatchedReceiver implements loggregator_v2.EgressServer.
func (*EgressServer) Receiver ¶
func (s *EgressServer) Receiver( req *loggregator_v2.EgressRequest, sender loggregator_v2.Egress_ReceiverServer, ) error
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 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 (i IngressServer) BatchSender(s loggregator_v2.Ingress_BatchSenderServer) error
func (IngressServer) Send ¶
func (i IngressServer) Send( _ context.Context, _ *loggregator_v2.EnvelopeBatch, ) (*loggregator_v2.SendResponse, error)
func (IngressServer) Sender ¶
func (i IngressServer) Sender(s loggregator_v2.Ingress_SenderServer) error
TODO Remove the Sender method onces we are certain all Metrons are using the BatchSender method
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 Repeater ¶
type Repeater struct {
// contains filtered or unexported fields
}
Repeater connects a reader to a writer.
func NewRepeater ¶
NewRepeater is the constructor for Repeater.
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 { }