# README
go-loggregator 


This is a golang client library for Loggregator.
Versions
At present, Loggregator supports two API versions: v1 (UDP) and v2 (gRPC). This library provides clients for both versions.
Note that this library is also versioned. Its versions have no relation to the Loggregator API. Presently, v2.0.0 is the most recent release.
Usage
This repository should be imported as:
import loggregator "code.cloudfoundry.org/go-loggregator"
Example
Example implementation of the client is provided in examples/main.go
.
Build the example client by running go build -o client main.go
Collocate the client
with a metron agent and set the following environment
variables: CA_CERT_PATH
, CERT_PATH
, KEY_PATH
# Packages
loggregator provides a top-level client for connecting to the loggregator v1 and v2 API's.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
v1 provides a client to connect with the loggregtor v1 API
Loggregator's v1 client library is better known to the Cloud Foundry community as Dropsonde (github.com/cloudfoundry/dropsonde).
# Functions
NewEgressClient creates a new EgressClient for the given addr and TLS configuration.
NewEgressTLSConfig provides a convenient means for creating a *tls.Config which uses the CA, cert, and key for the egress endpoint.
NewIngressClient creates a v2 loggregator client.
NewIngressTLSConfig provides a convenient means for creating a *tls.Config which uses the CA, cert, and key for the ingress endpoint.
NewRawIngressClient creates a new RawIngressClient.
WithAddr allows for the configuration of the loggregator v2 address.
WithAppInfo configures the meta data associated with emitted data.
WithBatchFlushInterval allows for the configuration of the maximum time to wait before sending a batch of messages.
WithBatchMaxSize allows for the configuration of the number of messages to collect before emitting them into loggregator.
WithDecimalTag allows for the configuration of arbitrary decimal value metadata which will be included in all data sent to Loggregator.
WithDelta is an option that sets the delta for a counter.
WithEnvelopeDecimalTag adds a decimal tag to the envelope.
WithEnvelopeIntegerTag adds a integer tag to the envelope.
WithEnvelopeStringTag adds a string tag to the envelope.
WithGaugeAppInfo configures an ID associated with the gauge.
WithGaugeTags adds tag information that can be text, integer, or decimal to the envelope.
WithGaugeValue adds a gauge information.
WithIntegerTag allows for the configuration of arbitrary integer value metadata which will be included in all data sent to Loggregator.
WithLogger allows for the configuration of a logger.
WithStdout sets the output type to stdout.
WithStringTag allows for the configuration of arbitrary string value metadata which will be included in all data sent to Loggregator.
# Structs
EgressClient wraps the gRPC EgressClient for convenience.
IngressClient represents an emitter into loggregator.
RawIngressClient is an emitter of bare envelopes to loggregator.
# Interfaces
Logger declares the minimal logging interface used within the v2 client.
# Type aliases
EmitCounterOption is the option type passed into EmitCounter.
EmitGaugeOption is the option type passed into EmitGauge.
EmitLogOption is the option type passed into EmitLog.
IngressOption is the type of a configurable client option.