Documentation ¶
Index ¶
- func StatusCounts(seekers []*Seeker) (map[Status]int, error)
- type CommandExecError
- type Commander
- type Copier
- type CopyFilesError
- type FindFilesError
- type FormatUnknownError
- type HTTPer
- type MakeDirError
- type Runner
- type Seeker
- func Exclude(excludes []string, seekers []*Seeker) ([]*Seeker, error)
- func NewCommander(command string, format string) *Seeker
- func NewCopier(path, destDir string, since, until time.Time) *Seeker
- func NewHTTPer(client *client.APIClient, path string) *Seeker
- func NewSheller(command string) *Seeker
- func Select(selects []string, seekers []*Seeker) ([]*Seeker, error)
- type ShellExecError
- type Sheller
- type Status
- type UnmarshalError
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type CommandExecError ¶ added in v0.3.0
type CommandExecError struct {
// contains filtered or unexported fields
}
func (CommandExecError) Error ¶ added in v0.3.0
func (e CommandExecError) Error() string
func (CommandExecError) Unwrap ¶ added in v0.3.0
func (e CommandExecError) Unwrap() error
type Commander ¶
type Commander struct { Command string `json:"command"` // contains filtered or unexported fields }
Commander runs shell commands.
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"` }
Copier copies files to temp dir based on a filter.
type CopyFilesError ¶ added in v0.3.0
type CopyFilesError struct {
// contains filtered or unexported fields
}
func (CopyFilesError) Error ¶ added in v0.3.0
func (e CopyFilesError) Error() string
func (CopyFilesError) Unwrap ¶ added in v0.3.0
func (e CopyFilesError) Unwrap() error
type FindFilesError ¶ added in v0.3.0
type FindFilesError struct {
// contains filtered or unexported fields
}
func (FindFilesError) Error ¶ added in v0.3.0
func (e FindFilesError) Error() string
func (FindFilesError) Unwrap ¶ added in v0.3.0
func (e FindFilesError) Unwrap() error
type FormatUnknownError ¶ added in v0.3.0
type FormatUnknownError struct {
// contains filtered or unexported fields
}
func (FormatUnknownError) Error ¶ added in v0.3.0
func (e FormatUnknownError) Error() string
type MakeDirError ¶ added in v0.3.0
type MakeDirError struct {
// contains filtered or unexported fields
}
func (MakeDirError) Error ¶ added in v0.3.0
func (e MakeDirError) Error() string
func (MakeDirError) Unwrap ¶ added in v0.3.0
func (e MakeDirError) Unwrap() error
type Seeker ¶
type Seeker struct { Runner Runner `json:"runner"` Identifier string `json:"-"` Result interface{} `json:"result"` ErrString string `json:"error"` // this simplifies json marshaling Error error `json:"-"` Status Status `json:"status"` }
Seeker seeks information via its Runner then stores the results.
func Exclude ¶
Exclude takes a slice of matcher strings and a slice of seekers. If any of the seeker identifiers match the exclude according to filepath.Match() then it will not be present in the returned seeker 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 seekers several times. Not likely to be a huge speed increase though... we're not even remotely bottlenecked on seeker filtering.
func NewCommander ¶
NewCommander provides a Seeker for running shell commands.
func NewSheller ¶
NewSheller provides a Seeker for running shell commands.
type ShellExecError ¶ added in v0.3.0
type ShellExecError struct {
// contains filtered or unexported fields
}
func (ShellExecError) Error ¶ added in v0.3.0
func (e ShellExecError) Error() string
func (ShellExecError) Unwrap ¶ added in v0.3.0
func (e ShellExecError) Unwrap() error
type Status ¶ added in v0.3.0
type Status string
Status describes the result of a seeker run
const ( // Success means all systems green Success Status = "success" // Fail means that we detected a known error and can conclusively say that the seeker did not complete. Fail Status = "fail" // Unknown means that we detected an error and the result is indeterminate (e.g. some side effect like disk or // network may or may not have completed) or we don't recognize the error. If we don't recognize the error that's // a signal to improve the error handling to account for it. Unknown Status = "unknown" )
type UnmarshalError ¶ added in v0.3.0
type UnmarshalError struct {
// contains filtered or unexported fields
}
func (UnmarshalError) Error ¶ added in v0.3.0
func (e UnmarshalError) Error() string
func (UnmarshalError) Unwrap ¶ added in v0.3.0
func (e UnmarshalError) Unwrap() error
Click to show internal directories.
Click to hide internal directories.