inputsocket

package
v0.0.0-...-7697303 Latest Latest
Warning

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

Go to latest
Published: Sep 14, 2017 License: LGPL-3.0 Imports: 11 Imported by: 0

README

socket input

Synopsis

{
	"input": [
		{
			"type": "socket",

			// Socket type. Must be one of ["tcp", "unix", "unixpacket"].
			"socket": "tcp",

			// For TCP, address must have the form `host:port`.
			// For Unix networks, the address must be a file system path.
			"address": "localhost:9999"
		}
	]
}

Note: at the moment, this input only works with connection-oriented sockets.

Datagram-oriented sockets like UDP or UNIXGRAM socket are not supported.

Documentation

Index

Constants

View Source
const ModuleName = "socket"

ModuleName is the name used in config file

Variables

View Source
var (
	ErrorUnknownSocketType1 = errutil.NewFactory("%q is not a valid socket type")
	ErrorSocketAccept       = errutil.NewFactory("socket accept error")
)

errors

Functions

func InitHandler

func InitHandler(ctx context.Context, raw *config.ConfigRaw) (config.TypeInputConfig, error)

InitHandler initialize the input plugin

Types

type InputConfig

type InputConfig struct {
	config.InputConfig
	Socket  string `json:"socket"`  // Type of socket, must be one of ["tcp", "unix", "unixpacket"].
	Address string `json:"address"` // For TCP, address must have the form `host:port`. For Unix networks, the address must be a file system path.
}

InputConfig holds the configuration json fields and internal objects

func DefaultInputConfig

func DefaultInputConfig() InputConfig

DefaultInputConfig returns an InputConfig struct with default values

func (*InputConfig) Start

func (i *InputConfig) Start(ctx context.Context, msgChan chan<- logevent.LogEvent) error

Start wraps the actual function starting the plugin

Jump to

Keyboard shortcuts

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