runner

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Aug 26, 2022 License: MPL-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Params

func Params(r Runner) map[string]interface{}

Params takes a Runner and returns a map of its public fields

Types

type CommandExecError

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

func (CommandExecError) Error

func (e CommandExecError) Error() string

func (CommandExecError) Unwrap

func (e CommandExecError) Unwrap() error

type Commander

type Commander struct {
	Command    string           `json:"command"`
	Format     string           `json:"format"`
	Redactions []*redact.Redact `json:"redactions"`
}

Commander runs shell commands.

func NewCommander

func NewCommander(command string, format string, redactions []*redact.Redact) *Commander

NewCommander provides a runner for bin commands

func (Commander) ID

func (c Commander) ID() string

func (Commander) Run

func (c Commander) Run() op.Op

Run executes the Command

type Copier

type Copier struct {
	SourceDir  string           `json:"source_directory"`
	Filter     string           `json:"filter"`
	DestDir    string           `json:"destination_directory"`
	Since      time.Time        `json:"since"`
	Until      time.Time        `json:"until"`
	Redactions []*redact.Redact `json:"redactions"`
}

Copier copies files to temp dir based on a filter.

func NewCopier

func NewCopier(path, destDir string, since, until time.Time, redactions []*redact.Redact) *Copier

NewCopier provides a Runner for copying files to temp dir based on a filter.

func (Copier) ID

func (c Copier) ID() string

func (Copier) Run

func (c Copier) Run() op.Op

Run satisfies the Runner interface and copies the filtered source files to the destination.

type CopyFilesError

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

func (CopyFilesError) Error

func (e CopyFilesError) Error() string

func (CopyFilesError) Unwrap

func (e CopyFilesError) Unwrap() error

type FindFilesError

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

func (FindFilesError) Error

func (e FindFilesError) Error() string

func (FindFilesError) Unwrap

func (e FindFilesError) Unwrap() error

type FormatUnknownError

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

func (FormatUnknownError) Error

func (e FormatUnknownError) Error() string

type HTTPer

type HTTPer struct {
	Path       string            `json:"path"`
	Client     *client.APIClient `json:"client"`
	Redactions []*redact.Redact  `json:"redactions"`
}

HTTPer hits APIs.

func NewHTTPer

func NewHTTPer(client *client.APIClient, path string, redactions []*redact.Redact) *HTTPer

func (HTTPer) ID

func (h HTTPer) ID() string

func (HTTPer) Run

func (h HTTPer) Run() op.Op

Run executes a GET request to the Path using the Client

type MakeDirError

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

func (MakeDirError) Error

func (e MakeDirError) Error() string

func (MakeDirError) Unwrap

func (e MakeDirError) Unwrap() error

type Runner

type Runner interface {
	ID() string
	Run() op.Op
}

Runner runs things to get information.

func Exclude

func Exclude(excludes []string, runners []Runner) ([]Runner, error)

Exclude takes a slice of matcher strings and a slice of ops. If any of the runner identifiers match the exclude according to filepath.Match() then it will not be present in the returned runner slice. NOTE(mkcp): This is precisely identical to Select() except we flip the match check. Maybe we can perform both rounds

of filtering in one pass one rather than iterating over all the ops several times. Not likely to be a huge speed
increase though... we're not even remotely bottlenecked on runner filtering.

func Select

func Select(selects []string, runners []Runner) ([]Runner, error)

Select takes a slice of matcher strings and a slice of ops. The only ops returned will be those matching the given select strings according to filepath.Match()

type ShellExecError

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

func (ShellExecError) Error

func (e ShellExecError) Error() string

func (ShellExecError) Unwrap

func (e ShellExecError) Unwrap() error

type Sheller

type Sheller struct {
	Command    string           `json:"command"`
	Shell      string           `json:"shell"`
	Redactions []*redact.Redact `json:"redactions"`
}

Sheller runs shell commands in a real unix shell.

func NewSheller

func NewSheller(command string, redactions []*redact.Redact) *Sheller

NewSheller provides a runner for arbitrary shell code.

func (Sheller) ID

func (s Sheller) ID() string

func (Sheller) Run

func (s Sheller) Run() op.Op

Run ensures a shell exists and optimistically executes the given Command string

type UnmarshalError

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

func (UnmarshalError) Error

func (e UnmarshalError) Error() string

func (UnmarshalError) Unwrap

func (e UnmarshalError) Unwrap() error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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