acquisition

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: May 15, 2020 License: MIT Imports: 17 Imported by: 2 modules, 1 package

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const (
	TAILMODE = "tail"
	CATMODE  = "cat"
)
View Source
const (
	FILETYPE = "file"
	BINTYPE  = "bin"
)

Variables

View Source
var ReaderHits = prometheus.NewCounterVec(
	prometheus.CounterOpts{
		Name: "cs_reader_hits",
		Help: "How many lines where read.",
	},
	[]string{"source"},
)

Functions

func AcquisReadOneFile

func AcquisReadOneFile(ctx FileCtx, output chan types.Event, AcquisTomb *tomb.Tomb) error

A tail-mode file reader (tail)

func AcquisStartReading

func AcquisStartReading(ctx *FileAcquisCtx, output chan types.Event, AcquisTomb *tomb.Tomb)

let's return an array of chans for signaling for now

func ReadAtOnce

func ReadAtOnce(ctx FileCtx, output chan types.Event, AcquisTomb *tomb.Tomb) error

A one shot file reader (cat)

Types

type Acquisition

type Acquisition interface {
	Init(map[string]interface{}) (interface{}, error)
	ReadOne(interface{}) (string, error)
}

type FileAcquisCtx

type FileAcquisCtx struct {
	Files     []FileCtx
	Profiling bool
}

func InitReader

func InitReader(cfg string) (*FileAcquisCtx, error)

func InitReaderFromFileCtx

func InitReaderFromFileCtx(files []FileCtx) (*FileAcquisCtx, error)

InitReader iterates over the FileCtx objects of cfg and resolves globbing to open files

type FileCtx

type FileCtx struct {
	Type      string   `yaml:"type,omitempty"` //file|bin|...
	Mode      string   `yaml:"mode,omitempty"` //tail|cat|...
	Filename  string   `yaml:"filename,omitempty"`
	Filenames []string `yaml:"filenames,omitempty"`

	Labels    map[string]string `yaml:"labels,omitempty"`
	Profiling bool              `yaml:"profiling,omitempty"`
	// contains filtered or unexported fields
}

Jump to

Keyboard shortcuts

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