client

package
v0.0.0-...-3dd6856 Latest Latest
Warning

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

Go to latest
Published: May 20, 2019 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddrToHostPort

func AddrToHostPort(remoteAddr net.Addr) (string, int)

AddrToHostPort converts a net.Addr to a (string, int).

Types

type ConnectionManager

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

A ConnectionManager manages connections

func NewConnectionManager

func NewConnectionManager(endpoint Endpoint) *ConnectionManager

NewConnectionManager returns an initialized ConnectionManager

func (*ConnectionManager) CloseConnection

func (cm *ConnectionManager) CloseConnection(conn net.Conn)

CloseConnection closes a connection on the client side

func (*ConnectionManager) NewConnection

func (cm *ConnectionManager) NewConnection(ctx context.Context) (net.Conn, error)

NewConnection returns an initialized connection to the intake. It blocks until a connection is available

type Delimiter

type Delimiter interface {
	// contains filtered or unexported methods
}

Delimiter is responsible for adding delimiters to the frames being sent.

func NewDelimiter

func NewDelimiter(useProto bool) Delimiter

NewDelimiter returns a delimiter.

type Destination

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

Destination is responsible for shipping logs to a remote server over TCP.

func AddrToDestination

func AddrToDestination(addr net.Addr, ctx *DestinationsContext) *Destination

AddrToDestination creates a Destination from an Addr

func NewDestination

func NewDestination(endpoint Endpoint, destinationsContext *DestinationsContext) *Destination

NewDestination returns a new destination.

func (*Destination) Send

func (d *Destination) Send(payload []byte) error

Send transforms a message into a frame and sends it to a remote server, returns an error if the operation failed.

func (*Destination) SendAsync

func (d *Destination) SendAsync(payload []byte)

SendAsync sends a message to the destination without blocking. If the channel is full, the incoming messages will be dropped

type Destinations

type Destinations struct {
	Main        *Destination
	Additionals []*Destination
}

Destinations holds the main destination and additional ones to send logs to.

func NewDestinations

func NewDestinations(main *Destination, additionals []*Destination) *Destinations

NewDestinations returns a new destinations composite.

type DestinationsContext

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

A DestinationsContext manages senders and allows us to "unclog" the pipeline when trying to stop it and failing to send messages.

func NewDestinationsContext

func NewDestinationsContext() *DestinationsContext

NewDestinationsContext returns an initialized ConnectionManager

func (*DestinationsContext) Context

func (dc *DestinationsContext) Context() context.Context

Context allows one to access the current context of this DestinationsContext.

func (*DestinationsContext) Start

func (dc *DestinationsContext) Start()

Start creates a context that will be cancelled on Stop()

func (*DestinationsContext) Stop

func (dc *DestinationsContext) Stop()

Stop cancels the context that should be used by all senders.

type Endpoint

type Endpoint struct {
	APIKey       string `mapstructure:"api_key"`
	Host         string
	Port         int
	UseSSL       bool
	UseProto     bool
	ProxyAddress string
}

Endpoint holds all the organization and network parameters to send logs to Datadog.

func AddrToEndPoint

func AddrToEndPoint(addr net.Addr) Endpoint

AddrToEndPoint creates an EndPoint from an Addr.

type Endpoints

type Endpoints struct {
	Main        Endpoint
	Additionals []Endpoint
}

Endpoints holds the main endpoint and additional ones to dualship logs.

func NewEndpoints

func NewEndpoints(main Endpoint, additionals []Endpoint) *Endpoints

NewEndpoints returns a new endpoints composite.

type FramingError

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

FramingError represents a kind of error that can occur when a log can not properly be transformed into a frame.

func NewFramingError

func NewFramingError(err error) *FramingError

NewFramingError returns a new framing error.

func (*FramingError) Error

func (e *FramingError) Error() string

Error returns the message of the error.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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