tcp

package
v0.54.0-devel Latest Latest
Warning

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

Go to latest
Published: Apr 1, 2024 License: Apache-2.0 Imports: 20 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, status statusinterface.Status) *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

func (*ConnectionManager) ShouldReset

func (cm *ConnectionManager) ShouldReset(connCreationTime time.Time) bool

ShouldReset returns whether the connection should be reset, depending on the endpoint's config and the passed connection creation time.

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, status statusinterface.Status) *Destination

AddrToDestination creates a Destination from an Addr

func NewDestination

func NewDestination(endpoint config.Endpoint, useProto bool, destinationsContext *client.DestinationsContext, shouldRetry bool, status statusinterface.Status) *Destination

NewDestination returns a new destination.

func (*Destination) IsHA

func (d *Destination) IsHA() bool

IsHA indicates that this destination is a High Availability destination.

func (*Destination) Start

func (d *Destination) Start(input chan *message.Payload, output chan *message.Payload, isRetrying chan bool) (stopChan <-chan struct{})

Start reads from the input, transforms a message into a frame and sends it to a remote server,

func (*Destination) Target

func (d *Destination) Target() string

Target is the address of the destination.

Jump to

Keyboard shortcuts

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