v1

package
v8.0.5 Latest Latest
Warning

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

Go to latest
Published: Jun 17, 2021 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Overview

Package 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). The code here wraps that library in the interest of consolidating all client code into a single library which includes both v1 and v2 clients.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

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

Client represents an emitter into loggregator. It should be created with the NewClient constructor.

func NewClient

func NewClient(opts ...ClientOption) (*Client, error)

NewClient creates a v1 loggregator client. This is a wrapper around the dropsonde package that will write envelopes to loggregator over UDP. Before calling NewClient you should call dropsonde.Initialize.

func (*Client) EmitCounter

func (c *Client) EmitCounter(name string, opts ...loggregator.EmitCounterOption)

EmitCounter sends a counter envelope with a delta of 1.

func (*Client) EmitGauge

func (c *Client) EmitGauge(opts ...loggregator.EmitGaugeOption)

EmitGauge sends the configured gauge values to loggregator. If no EmitGaugeOption values are present, no envelopes will be emitted.

func (*Client) EmitLog

func (c *Client) EmitLog(message string, opts ...loggregator.EmitLogOption)

EmitLog sends a message to loggregator.

type ClientOption

type ClientOption func(*Client)

func WithLogger

func WithLogger(l loggregator.Logger) ClientOption

WithLogger allows for the configuration of a logger. By default, the logger is disabled.

func WithTag

func WithTag(name, value string) ClientOption

WithTag allows for the configuration of arbitrary string value metadata which will be included in all data sent to Loggregator

Jump to

Keyboard shortcuts

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