analyzer

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Aug 23, 2021 License: BSD-3-Clause Imports: 25 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Run added in v0.0.6

func Run(ctx context.Context, pcap io.Reader, w zio.Writer, d Display, interval time.Duration, confs ...Config) error

Run executes the provided configs against the pcap stream, writing the produced records to w. If interval is > 0, the d.Stats will be called at that interval.

Types

type Config

type Config struct {
	Args       []string         `yaml:"args"`
	Cmd        string           `yaml:"cmd"`
	Globs      []string         `yaml:"globs"`
	ReaderOpts anyio.ReaderOpts `yaml:"-"`
	Shaper     string           `yaml:"shaper"`
	StdoutPath string           `yaml:"stdout"`
	StderrPath string           `yaml:"stderr"`
	// WorkDir if set uses the provided directory as the working directory for
	// the launched analyzer process. Normally a temporary directory is created
	// then deleted when the process is complete. If WorkDir is set the working
	// directory will not be deleted.
	WorkDir string `yaml:"workdir"`
}

func LoadYAMLConfigFile

func LoadYAMLConfigFile(path string) ([]Config, error)

type Configs added in v0.0.6

type Configs []Config

func (Configs) Validate added in v0.0.6

func (cs Configs) Validate() (merr error)

type Display added in v0.0.6

type Display interface {
	zio.Warner
	Stats(Stats) error
}

type ProcessExitError

type ProcessExitError struct {
	Err    *exec.ExitError
	Path   string
	Stderr []byte
	Stdout []byte
}

func (*ProcessExitError) Error

func (p *ProcessExitError) Error() string

type Stats added in v0.0.6

type Stats struct {
	BytesRead      int64
	RecordsWritten int64
}

Jump to

Keyboard shortcuts

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