plans

package
v0.12.0 Latest Latest
Warning

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

Go to latest
Published: Mar 13, 2018 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

View Source
const (
	StreamFormatTar = "tar"
)

Variables

This section is empty.

Functions

func RawScrubber

func RawScrubber(scrubSpec *types.Scrub) (types.BytesScrubber, error)

RawScrubber creates a scrubber function from a scrubSpec

Types

type ByteSource

type ByteSource struct {
	// Producer provides the seed data for this task
	Producer func(context.Context) ([]byte, error)
	// RawScrubber, if defined, rewrites the raw data to to remove sensitive data
	RawScrubber func([]byte) []byte
	// Parser, if defined, structures the raw data for json and human sinks
	Parser func(io.Reader) (interface{}, error)
	// StructuredScrubber, if defined, rewrites the structured data to remove sensitive data
	//StructedScrubber func(interface{}) (interface{}, error)
	// Template, if defined, renders structured data in a human-readable format
	Template string
	// If RawPath is defined it will get a copy of the raw data []byte
	RawPath string
	// If JSONPath is defined and Parser is defined, it will get a jsonified
	// copy of the strucutred data. If JSONPath is defined and Parser is not,
	// it will get a copy of the raw data.
	JSONPath string
	// If HumanPath is defined and Parser and Template are defined, it will get
	// the output of the template rendered with the structure context. If
	// HumanPath and Parser are defined but Template is not, it will get a YAML
	// copy of the structured data. If HumanPath is defined and Parser is not,
	// it will get a copy of the raw data.
	HumanPath string
	// If Timeout is defined, it will be used rather than the context provided
	// to Exec.
	Timeout time.Duration
}

ByteSource is a Task that gets its data source as a []byte.

func (*ByteSource) Exec

func (task *ByteSource) Exec(ctx context.Context, rootDir string) []*types.Result

type Prepared

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

Prepared is a Task that returns preconfigured Results.

func PreparedError

func PreparedError(err error, spec types.Spec) Prepared

Prepare results for an incomplete spec

func (Prepared) Exec

func (p Prepared) Exec(ctx context.Context, rootDir string) []*types.Result

type StreamSource

type StreamSource struct {
	Spec types.Spec

	// Producer provides the seed data for this task as an io.Reader
	Producer func(context.Context) (io.Reader, error)
	// StreamFormat describe stream format returned by Producer.  Only "" and "tar" are supported.
	StreamFormat string
	// RawScrubber, if defined, rewrites the raw data to to remove sensitive data
	RawScrubber func([]byte) []byte
	// Parser, if defined, structures the raw data for json and human sinks
	Parser func(io.Reader) (interface{}, error)
	// Template, if defined, renders structured data in a human-readable format
	Template string
	// If RawPath is defined it will get a copy of the data
	RawPath string
	// If JSONPath is defined it will get a copy of the data
	JSONPath string
	// If HumanPath is defined it will get a copy of the data
	HumanPath string
	// If Timeout is defined, it will be used rather than the context provided
	// to Exec.
	Timeout time.Duration
}

StreamSource is a Task that gets its data as an io.Reader

func SetCommonFieldsStreamSource added in v0.11.0

func SetCommonFieldsStreamSource(task StreamSource, spec types.Spec) (StreamSource, error)

func (*StreamSource) Exec

func (task *StreamSource) Exec(ctx context.Context, rootDir string) []*types.Result

type StreamsSource

type StreamsSource struct {
	Spec types.Spec

	// Producer provides the seed data for this task as an io.Reader array
	// Names of the sources are provided as a string array
	Producer func(context.Context) (map[string]io.Reader, error)
	// StreamFormat describe stream format returned by Producer. Only "" and "tar" are supported.
	StreamFormat string
	// RawScrubber, if defined, rewrites the raw data to to remove sensitive data
	RawScrubber func([]byte) []byte
	// Parser, if defined, structures the raw data for json and human sinks
	Parser func(io.Reader) (interface{}, error)
	// Template, if defined, renders structured data in a human-readable format
	Template string
	// If RawPath is defined it will get a copy of the data
	RawPath string
	// If JSONPath is defined it will get a copy of the data
	JSONPath string
	// If HumanPath is defined it will get a copy of the data
	HumanPath string
	// If Timeout is defined, it will be used rather than the context provided
	// to Exec.
	Timeout time.Duration
}

StreamsSource is a Task that gets its data as an io.Reader

func SetCommonFieldsStreamsSource added in v0.11.0

func SetCommonFieldsStreamsSource(task StreamsSource, spec types.Spec) (StreamsSource, error)

func (*StreamsSource) Exec

func (task *StreamsSource) Exec(ctx context.Context, rootDir string) []*types.Result

type StructuredSource

type StructuredSource struct {
	Spec types.Spec

	// Producer provides the seed data for this task
	Producer func(context.Context) (interface{}, error)
	// RawScrubber, if defined, rewrites the raw data to to remove sensitive data
	RawScrubber func([]byte) []byte
	// Template, if defined, renders structured data in a human-readable format
	Template string
	// If RawPath is defined it will get a copy of the raw data []byte
	RawPath string
	// If JSONPath is defined and Parser is defined, it will get a jsonified
	// copy of the strucutred data. If JSONPath is defined and Parser is not,
	// it will get a copy of the raw data.
	JSONPath string
	// If HumanPath is defined and Parser and Template are defined, it will get
	// the output of the template rendered with the structure context. If
	// HumanPath and Parser are defined but Template is not, it will get a YAML
	// copy of the structured data. If HumanPath is defined and Parser is not,
	// it will get a copy of the raw data.
	HumanPath string
	// If Timeout is defined, it will be used rather than the context provided
	// to Exec.
	Timeout time.Duration
}

StructuredSource is a Task that gets its data as a structured object ready to be jsonified or used as a context in a human template.

func SetCommonFieldsStructuredSource added in v0.11.0

func SetCommonFieldsStructuredSource(task StructuredSource, spec types.Spec) (StructuredSource, error)

func (*StructuredSource) Exec

func (task *StructuredSource) Exec(ctx context.Context, rootDir string) []*types.Result

Jump to

Keyboard shortcuts

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