inputs

package
v0.0.0-...-5ddf7d0 Latest Latest
Warning

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

Go to latest
Published: Jan 5, 2022 License: LGPL-3.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const DEFAULT_LISTEN_ADDR = "localhost:4279"
View Source
const DEFAULT_SOCKET_PATH = "/run/clogger/clogger.sock"

Variables

This section is empty.

Functions

func HasConstructorFor

func HasConstructorFor(name string) bool

func NewSocketInput

func NewSocketInput(c SocketInputConfig) *socketInput

Types

type GoInput

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

func NewGoInput

func NewGoInput() *GoInput

func (*GoInput) Close

func (s *GoInput) Close(ctx context.Context) error

func (*GoInput) Enqueue

func (s *GoInput) Enqueue(msg string)

func (*GoInput) GetBatch

func (g *GoInput) GetBatch(ctx context.Context) (*clogger.MessageBatch, error)

func (*GoInput) Init

func (g *GoInput) Init(ctx context.Context) error

type Inputter

type Inputter interface {
	Init(ctx context.Context) error
	GetBatch(ctx context.Context) (*clogger.MessageBatch, error)
	Close(ctx context.Context) error
}

An Inputter is a thing that is able to read messages from somewhere

func Construct

func Construct(name string, config map[string]string) (Inputter, error)

Construct constructs an Inputter from the given name and config map, returning an error if the name or config is invalid

type JournalDInput

type JournalDInput struct {
	RecvConfig
	// contains filtered or unexported fields
}

JournalDInput is an Input that reads off of the JournalD stream

func NewJournalDInput

func NewJournalDInput(conf RecvConfig) (*JournalDInput, error)

NewJournalDInput constructs a JournalDInput with the given RecvConf defaulting to the CoreOSJournalDReader

func NewJournalDInputWithReader

func NewJournalDInputWithReader(conf RecvConfig, reader JournalDReader) (*JournalDInput, error)

Constructs a JournalDInput with the given reader, incase we have any others in the future

func (*JournalDInput) Close

func (j *JournalDInput) Close(ctx context.Context) error

func (*JournalDInput) GetBatch

func (j *JournalDInput) GetBatch(ctx context.Context) (*clogger.MessageBatch, error)

Gets a single batch of messages off of the JournalD stream

func (*JournalDInput) Init

func (j *JournalDInput) Init(ctx context.Context) error

type JournalDReader

type JournalDReader interface {
	// GetEntry reads a single message off of the end of the queue
	GetEntry(ctx context.Context) (clogger.Message, error)

	// Close is provided to clean up any sockets or anything when we exit
	Close()
}

JournalDReader is an interface that reads messages off the JournalD stream

type RecvConfig

type RecvConfig struct{}

func NewRecvConfig

func NewRecvConfig() RecvConfig

type SocketInputConfig

type SocketInputConfig struct {
	RecvConfig
	ListenAddr string
	TLS        *clogger.TLSConfig
	Type       SocketInputType
	Parser     parse.InputParser
}

type SocketInputType

type SocketInputType int
const (
	UNIX_SOCKET_INPUT SocketInputType = iota
	TCP_SOCKET_INPUT
)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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