socket

package
v1.30.2 Latest Latest
Warning

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

Go to latest
Published: Apr 22, 2024 License: MIT Imports: 25 Imported by: 0

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)

type CallbackError

type CallbackError func(error)

type Config

type Config struct {
	MaxConnections       int              `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"`
	tlsint.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