analyzer

package
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: Jun 7, 2021 License: BSD-3-Clause Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Args       []string         `yaml:"args"`
	Cmd        string           `yaml:"cmd"`
	Globs      []string         `yaml:"globs"`
	Launcher   Launcher         `yaml:"-"`
	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 Interface

type Interface interface {
	zio.ReadCloser
	BytesRead() int64
	RecordsRead() int64
	WarningHandler(zio.Warner)
}

func Combiner

func Combiner(zctx *zson.Context, pcap io.Reader, confs ...Config) Interface

func CombinerWithContext

func CombinerWithContext(ctx context.Context, zctx *zson.Context, pcap io.Reader, confs ...Config) Interface

func New

func New(zctx *zson.Context, r io.Reader, conf Config) Interface

func NewWithContext

func NewWithContext(ctx context.Context, zctx *zson.Context, r io.Reader, conf Config) Interface

type Launcher

type Launcher func(context.Context, string, io.Reader) (ProcessWaiter, error)

Launcher is a function to start a pcap import process given a context, input pcap reader, and target output dir. If the process is started successfully, a ProcessWaiter and nil error are returned. If there is an error starting the Process, that error is returned.

type Process

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

func NewProcess

func NewProcess(cmd *exec.Cmd) *Process

func (*Process) SetStdio

func (p *Process) SetStdio(stderr string, stdout string) error

func (*Process) Start

func (p *Process) Start() error

func (*Process) Wait

func (p *Process) Wait() error

type ProcessExitError

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

func (*ProcessExitError) Error

func (p *ProcessExitError) Error() string

type ProcessWaiter

type ProcessWaiter interface {
	// Wait waits for a running process to exit, returning any errors that
	// occur.
	Wait() error
}

ProcessWaiter is an interface for interacting with a running process.

Directories

Path Synopsis
Package mock is a generated GoMock package.
Package mock is a generated GoMock package.

Jump to

Keyboard shortcuts

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