Documentation
¶
Index ¶
- func BuildRunners[T Blocks](config T, tmpDir string, debugDuration time.Duration, ...) ([]runner.Runner, error)
- func BuildRunnersWithContext[T Blocks](ctx context.Context, config T, tmpDir string, debugDuration time.Duration, ...) ([]runner.Runner, error)
- func MapRedacts(redactions []Redact) ([]*redact.Redact, error)
- func ProductsMap(products []*Product) map[string]*Product
- func ValidateRedactions(redactions []Redact) error
- type Agent
- type Blocks
- type Command
- type ConsulDebug
- type Copy
- type Do
- type DockerLog
- type GET
- type HCL
- type Host
- type JournaldLog
- type NomadDebug
- type Product
- type Redact
- type Seq
- type Shell
- type VaultDebug
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BuildRunners ¶
func BuildRunners[T Blocks](config T, tmpDir string, debugDuration time.Duration, debugInterval time.Duration, c *client.APIClient, since, until time.Time, redactions []*redact.Redact) ([]runner.Runner, error)
BuildRunners steps through the HCLConfig structs and maps each runner config type to the corresponding New<Runner> function. All custom runners are reduced into a linear slice of runners and served back up to the product. No runners are returned if any config is invalid.
func BuildRunnersWithContext ¶ added in v0.5.0
func BuildRunnersWithContext[T Blocks](ctx context.Context, config T, tmpDir string, debugDuration time.Duration, debugInterval time.Duration, c *client.APIClient, since, until time.Time, redactions []*redact.Redact) ([]runner.Runner, error)
BuildRunnersWithContext is similar to BuildRunners but accepts a context.Context that will be passed into the runners.
func MapRedacts ¶
MapRedacts maps HCL redactions to "real" `redact.Redact`s
func ProductsMap ¶
ProductsMap takes the collection of products and returns a map that keys each product to its Name.
func ValidateRedactions ¶
ValidateRedactions takes a slice of redactions and ensures they match valid names.
Types ¶
type Agent ¶
type Agent struct {
// NOTE(dcohen) this is currently a separate config block, as opposed to a parent block of the others
Redactions []Redact `hcl:"redact,block" json:"redactions,omitempty"`
}
type ConsulDebug ¶ added in v0.5.0
type ConsulDebug struct {
Archive string `hcl:"archive" json:"archive"`
Duration string `hcl:"duration,optional" json:"duration"`
Interval string `hcl:"interval,optional" json:"interval"`
Captures []string `hcl:"captures,optional" json:"captures"`
Redactions []Redact `hcl:"redact,block" json:"redactions"`
}
type Do ¶ added in v0.5.0
type Do struct {
Label string `hcl:"name,label" json:"label"`
Description string `hcl:"description,optional" json:"since"`
Do []Do `hcl:"do,block" json:"do,omitempty"`
Seq []Seq `hcl:"seq,block" json:"seq,omitempty"`
// Runners
Commands []Command `hcl:"command,block" json:"commands,omitempty"`
Shells []Shell `hcl:"shell,block" json:"shells,omitempty"`
GETs []GET `hcl:"GET,block" json:"gets,omitempty"`
Copies []Copy `hcl:"copy,block" json:"copies,omitempty"`
DockerLogs []DockerLog `hcl:"docker-log,block" json:"docker_log,omitempty"`
JournaldLogs []JournaldLog `hcl:"journald-log,block" json:"journald_log,omitempty"`
VaultDebugs []VaultDebug `hcl:"vault-debug,block" json:"vault_debug,omitempty"`
ConsulDebugs []ConsulDebug `hcl:"consul-debug,block" json:"consul_debug,omitempty"`
NomadDebugs []NomadDebug `hcl:"nomad-debug,block" json:"nomad_debug,omitempty"`
}
type HCL ¶
type Host ¶
type Host struct {
// Do
Do []Do `hcl:"do,block" json:"do,omitempty"`
Seq []Seq `hcl:"seq,block" json:"seq,omitempty"`
// Runners
Commands []Command `hcl:"command,block" json:"commands,omitempty"`
Shells []Shell `hcl:"shell,block" json:"shells,omitempty"`
GETs []GET `hcl:"GET,block" json:"gets,omitempty"`
Copies []Copy `hcl:"copy,block" json:"copies,omitempty"`
DockerLogs []DockerLog `hcl:"docker-log,block" json:"docker_log,omitempty"`
JournaldLogs []JournaldLog `hcl:"journald-log,block" json:"journald_log,omitempty"`
// Filters
Excludes []string `hcl:"excludes,optional" json:"excludes,omitempty"`
Selects []string `hcl:"selects,optional" json:"selects,omitempty"`
// Params
Redactions []Redact `hcl:"redact,block" json:"redactions,omitempty"`
}
type JournaldLog ¶
type NomadDebug ¶ added in v0.5.0
type NomadDebug struct {
Duration string `hcl:"duration,optional" json:"duration"`
Interval string `hcl:"interval,optional" json:"interval"`
LogLevel string `hcl:"log-level,optional" json:"log_level"`
MaxNodes int `hcl:"max-nodes,optional" json:"max_nodes"`
NodeClass string `hcl:"node-class,optional" json:"node_class"`
NodeID string `hcl:"node-id,optional" json:"node_id"`
PprofDuration string `hcl:"pprof-duration,optional" json:"pprof_duration"`
PprofInterval string `hcl:"pprof-interval,optional" json:"pprof_interval"`
ServerID string `hcl:"server-id,optional" json:"server_id"`
Stale bool `hcl:"stale,optional" json:"stale"`
Verbose bool `hcl:"verbose,optional" json:"verbose"`
EventTopic []string `hcl:"targets,optional" json:"targets"`
Redactions []Redact `hcl:"redact,block" json:"redactions"`
}
type Product ¶
type Product struct {
Name string `hcl:"name,label" json:"name"`
// Do
Do []Do `hcl:"do,block" json:"do,omitempty"`
Seq []Seq `hcl:"seq,block" json:"seq,omitempty"`
// Runners
Commands []Command `hcl:"command,block" json:"commands,omitempty"`
Shells []Shell `hcl:"shell,block" json:"shells,omitempty"`
GETs []GET `hcl:"GET,block" json:"gets,omitempty"`
Copies []Copy `hcl:"copy,block" json:"copies,omitempty"`
DockerLogs []DockerLog `hcl:"docker-log,block" json:"docker_log,omitempty"`
JournaldLogs []JournaldLog `hcl:"journald-log,block" json:"journald_log,omitempty"`
VaultDebugs []VaultDebug `hcl:"vault-debug,block" json:"vault_debug,omitempty"`
ConsulDebugs []ConsulDebug `hcl:"consul-debug,block" json:"consul_debug,omitempty"`
NomadDebugs []NomadDebug `hcl:"nomad-debug,block" json:"nomad_debug,omitempty"`
Excludes []string `hcl:"excludes,optional" json:"excludes,omitempty"`
Selects []string `hcl:"selects,optional" json:"selects,omitempty"`
Redactions []Redact `hcl:"redact,block" json:"redactions,omitempty"`
}
type Seq ¶ added in v0.5.0
type Seq struct {
Label string `hcl:"name,label" json:"label"`
Description string `hcl:"description,optional" json:"since"`
Timeout string `hcl:"timeout,optional" json:"timeout,omitempty"`
// Do
Do []Do `hcl:"do,block" json:"do,omitempty"`
Seq []Seq `hcl:"seq,block" json:"seq,omitempty"`
// Runners
Commands []Command `hcl:"command,block" json:"commands,omitempty"`
Shells []Shell `hcl:"shell,block" json:"shells,omitempty"`
GETs []GET `hcl:"GET,block" json:"gets,omitempty"`
Copies []Copy `hcl:"copy,block" json:"copies,omitempty"`
DockerLogs []DockerLog `hcl:"docker-log,block" json:"docker_log,omitempty"`
JournaldLogs []JournaldLog `hcl:"journald-log,block" json:"journald_log,omitempty"`
VaultDebugs []VaultDebug `hcl:"vault-debug,block" json:"vault_debug,omitempty"`
ConsulDebugs []ConsulDebug `hcl:"consul-debug,block" json:"consul_debug,omitempty"`
NomadDebugs []NomadDebug `hcl:"nomad-debug,block" json:"nomad_debug,omitempty"`
}
type VaultDebug ¶ added in v0.5.0
type VaultDebug struct {
Compress string `hcl:"compress" json:"compress"`
Duration string `hcl:"duration,optional" json:"duration"`
Interval string `hcl:"interval,optional" json:"interval"`
LogFormat string `hcl:"log-format,optional" json:"log_format"`
MetricsInterval string `hcl:"metrics-interval,optional" json:"metrics_interval"`
Targets []string `hcl:"targets,optional" json:"targets"`
Redactions []Redact `hcl:"redact,block" json:"redactions"`
}
Click to show internal directories.
Click to hide internal directories.