socket

package
v1.37.2 Latest Latest
Warning

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

Go to latest
Published: Feb 2, 2026 License: MIT Imports: 28 Imported by: 2 modules, 2 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CallbackConnection

type CallbackConnection func(net.Addr, io.ReadCloser)

type CallbackData

type CallbackData func(net.Addr, []byte, time.Time)

type CallbackError

type CallbackError func(error)

type Config

type Config struct {
	MaxConnections       uint64           `toml:"max_connections"`
	ReadBufferSize       config.Size      `toml:"read_buffer_size"`
	ReadTimeout          config.Duration  `toml:"read_timeout"`
	KeepAlivePeriod      *config.Duration `toml:"keep_alive_period"`
	SocketMode           string           `toml:"socket_mode"`
	ContentEncoding      string           `toml:"content_encoding"`
	MaxDecompressionSize config.Size      `toml:"max_decompression_size"`
	MaxParallelParsers   int              `toml:"max_parallel_parsers"`
	AllowedSources       []net.IP         `toml:"allowed_sources"`
	common_tls.ServerConfig
}

func (*Config) NewSocket

func (cfg *Config) NewSocket(address string, splitcfg *SplitConfig, logger telegraf.Logger) (*Socket, error)

type Socket

type Socket struct {
	Config
	// contains filtered or unexported fields
}

func (*Socket) Address

func (s *Socket) Address() net.Addr

func (*Socket) Close

func (s *Socket) Close()

func (*Socket) Listen

func (s *Socket) Listen(onData CallbackData, onError CallbackError)

func (*Socket) ListenConnection

func (s *Socket) ListenConnection(onConnection CallbackConnection, onError CallbackError)

func (*Socket) Setup

func (s *Socket) Setup() error

type SplitConfig

type SplitConfig struct {
	SplittingStrategy    string          `toml:"splitting_strategy"`
	SplittingDelimiter   string          `toml:"splitting_delimiter"`
	SplittingLength      int             `toml:"splitting_length"`
	SplittingLengthField lengthFieldSpec `toml:"splitting_length_field"`
}

func (*SplitConfig) NewSplitter

func (cfg *SplitConfig) NewSplitter() (bufio.SplitFunc, error)

Jump to

Keyboard shortcuts

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