tcp

package
v0.8.0 Latest Latest
Warning

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

Go to latest
Published: Jul 23, 2020 License: Apache-2.0 Imports: 18 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddrToEndPoint

func AddrToEndPoint(addr net.Addr) config.Endpoint

AddrToEndPoint creates an EndPoint from an Addr.

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 config.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 *client.DestinationsContext) *Destination

AddrToDestination creates a Destination from an Addr

func NewDestination

func NewDestination(endpoint config.Endpoint, useProto bool, destinationsContext *client.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

Jump to

Keyboard shortcuts

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