beats: Index | Files

package udp

import ""


Package Files

config.go server.go


const Name = "udp"

Name is the human readable name and identifier.

type Config Uses

type Config struct {
    Host           string           `config:"host"`
    MaxMessageSize cfgtype.ByteSize `config:"max_message_size" validate:"positive,nonzero"`
    Timeout        time.Duration    `config:"timeout"`
    ReadBuffer     cfgtype.ByteSize `config:"read_buffer" validate:"positive"`

Config options for the UDPServer

type Server Uses

type Server struct {
    Listener *net.UDPConn
    // contains filtered or unexported fields

Server creates a simple UDP Server and listen to a specific host:port and will send any event received to the callback method.

func New Uses

func New(config *Config, callback inputsource.NetworkFunc) *Server

New returns a new UDPServer instance.

func (*Server) Start Uses

func (u *Server) Start() error

Start starts the UDP Server and listen to incoming events.

func (*Server) Stop Uses

func (u *Server) Stop()

Stop stops the current udp server.

Package udp imports 9 packages (graph) and is imported by 51 packages. Updated 2020-03-07. Refresh now. Tools for package owners.