sock

package
v0.0.0-...-83adff0 Latest Latest
Warning

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

Go to latest
Published: Jul 6, 2020 License: GPL-3.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrInvalidAddr invalid address.
	ErrInvalidAddr = errors.New("invalid address")
)

Functions

func DecodeConfig

func DecodeConfig(md toml.MetaData, primValue toml.Primitive) (c interface{}, err error)

func NewSock

func NewSock(ctx context.Context, config interface{}, output chan<- *event.ProcessorEvent) (input.Input, error)

Types

type Config

type Config struct {
	TcpAddr          string         `toml:"tcpAddr"`
	UdpAddr          string         `toml:"udpAddr"`
	ReadChanSize     int            `toml:"readChanSize"`
	TcpBatchMaxBytes int            `toml:"tcpBatchMaxBytes"`
	UdpPacketMaxSize int            `toml:"udpPacketMaxSize"`
	LogMaxBytes      int            `toml:"logMaxBytes"`
	UdpReadTimeout   xtime.Duration `toml:"udpReadTimeout"`
	TcpReadTimeout   xtime.Duration `toml:"tcpReadTimeout"`
}

func (*Config) ConfigValidate

func (c *Config) ConfigValidate() error

type Sock

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

func (*Sock) Ctx

func (s *Sock) Ctx() context.Context

func (*Sock) Run

func (s *Sock) Run() (err error)

func (*Sock) Stop

func (s *Sock) Stop()

Jump to

Keyboard shortcuts

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