tcp

package
v0.0.0-...-5655933 Latest Latest
Warning

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

Go to latest
Published: Oct 20, 2023 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ConnectionManager

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

A ConnectionManager manages connections

func NewConnectionManager

func NewConnectionManager(endpoint logsconfig.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

func (*ConnectionManager) ShouldReset

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

ShouldReset returns whether the connection should be reset, depending on the endpoint's logsconfig 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 NewDestination

func NewDestination(endpoint logsconfig.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