tcp

package
v0.15.0 Latest Latest
Warning

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

Go to latest
Published: May 14, 2026 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// DefaultTCPChannelSize is the default size of the data channel
	DefaultTCPChannelSize = 100

	// DefaultTCPWorkers is the default number of worker goroutines
	DefaultTCPWorkers = 1

	// DefaultTCPConnectTimeout is the default timeout for establishing TCP connections
	DefaultTCPConnectTimeout = 2 * time.Second

	// DefaultTCPWriteTimeout is the default timeout for writing data to TCP connections
	DefaultTCPWriteTimeout = 5 * time.Second

	// DefaultTCPStopTimeout is the default timeout for graceful shutdown
	DefaultTCPStopTimeout = 30 * time.Second
)

Variables

This section is empty.

Functions

This section is empty.

Types

type TCP

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

TCP implements the Output interface for TCP connections

func New

func New(logger *zap.Logger, host, port string, workers int, tlsConfig *tls.Config) (*TCP, error)

New creates a new TCP output instance

func (*TCP) ObserveBlitzOutputQueueSize added in v0.14.0

func (t *TCP) ObserveBlitzOutputQueueSize(_ context.Context, observer metric.Int64Observer) error

ObserveBlitzOutputQueueSize implements the output.ObservableCallbacks interface

func (*TCP) Stop

func (t *TCP) Stop(ctx context.Context) error

Stop gracefully shuts down all workers and closes TCP connections Stop shall not be called more than once. If the provided context is done, Stop will return immediately even if workers are still shutting down.

func (*TCP) Write

func (t *TCP) Write(ctx context.Context, data output.LogRecord) error

Write sends data to the TCP output channel for processing by workers. Write shall not be called after Stop is called. If the provided context is done, Write will return immediately even if the data is not written to the channel.

Jump to

Keyboard shortcuts

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