gelfudp

package
v0.2.8 Latest Latest
Warning

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

Go to latest
Published: Apr 9, 2021 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MaxDatagramSize = 1420
	HeadSize        = 12
	MaxChunkSize    = MaxDatagramSize - HeadSize
	MaxChunks       = 128
	MaxMessageSize  = MaxChunkSize * MaxChunks

	CompressionNone = 0
	CompressionGzip = 1
	CompressionZlib = 2
)

Variables

View Source
var ErrTooLargeMessageSize = errors.New("too large message size")
View Source
var Magic = []byte{0x1e, 0x0f}

Functions

func GuessIP

func GuessIP() (uint64, error)

Types

type Compressor

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

func NewCompressor

func NewCompressor(compressionType string, compressionLevel int) (*Compressor, error)

func (*Compressor) Compress

func (c *Compressor) Compress(buf []byte) (int, []byte, error)

type Config

type Config struct {
	Host             string `logn-config:"host"`
	Port             int    `logn-config:"port"`
	CompressionType  string `logn-config:"compression_type" logn-validate:"logn.oneof=none gzip zlib"`
	CompressionLevel int    `logn-config:"compression_level"`
}

type DefaultIdGenerator

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

func NewDefaultIdGenerator

func NewDefaultIdGenerator(ip uint64) *DefaultIdGenerator

func (*DefaultIdGenerator) NextId

func (g *DefaultIdGenerator) NextId() uint64

type IdGenerator

type IdGenerator interface {
	NextId() uint64
}

type UDPSender

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

func NewUDPSender

func NewUDPSender(address string) (*UDPSender, error)

func (*UDPSender) Send

func (s *UDPSender) Send(message []byte) error

type Writer

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

func (*Writer) Write

func (w *Writer) Write(p []byte) (n int, err error)

Jump to

Keyboard shortcuts

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