types

package
v0.5.1 Latest Latest
Warning

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

Go to latest
Published: Nov 13, 2017 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FiltersToArgs added in v0.5.0

func FiltersToArgs(f map[string][]string) filters.Args

Types

type BytesProducer

type BytesProducer func(context.Context) ([]byte, error)

func BytesProducerFromStreamProducer added in v0.2.0

func BytesProducerFromStreamProducer(ss StreamProducer) BytesProducer

type BytesScrubber

type BytesScrubber func([]byte) []byte

type Config

type Config struct {
	FilePath      string   `json:"file_path"`
	Args          []string `json:"args"`
	Image         string   `json:"image"`
	EnablePull    bool     `json:"enable_pull"`
	ContainerID   string   `json:"container_id"`
	ContainerName string   `json:"container_name"`
	Command       string   `json:"command"`
	Scrub         Scrub    `json:"scrub"` // TODO: should we pull scrub up one level into Spec?
}

type ContainerListOptions added in v0.5.0

type ContainerListOptions struct {
	dockertypes.ContainerListOptions
	Filters map[string][]string
}

func (ContainerListOptions) ToDockerContainerListOptions added in v0.5.0

func (opts ContainerListOptions) ToDockerContainerListOptions() dockertypes.ContainerListOptions

type Doc

type Doc struct {
	Specs []Spec
}

type DockerContainerInspectOptions added in v0.2.0

type DockerContainerInspectOptions struct {
	ContainerListOptions ContainerListOptions `json:"container_list_options"`
}

type DockerContainerLogsOptions added in v0.2.0

type DockerContainerLogsOptions struct {
	ContainerListOptions ContainerListOptions `json:"container_list_options"`
}

type DockerRunCommandOptions

type DockerRunCommandOptions struct {
	ContainerCreateConfig dockertypes.ContainerCreateConfig
	EnablePull            bool
}

type HTTPRequestCommandOptions added in v0.2.0

type HTTPRequestCommandOptions struct {
	URL      string              `json:"url"`
	Method   string              `json:"method,omitempty"` // default "get"
	Body     string              `json:"body,omitempty"`
	Header   map[string][]string `json:"header,omitempty"`
	Insecure bool                `json:"insecure,omitempty"`
}

type JournaldLogs added in v0.5.0

type JournaldLogs struct {
	Unit  string
	Since string
}

type Planner

type Planner func(Spec) []Task

type Plugin

type Plugin map[string]Planner

type Result

type Result struct {
	Description string `json:"description"`
	// The subpath within the bundle
	Path  string `json:"path"`
	Error error  `json:"error,omitempty"`
}

Result represents a single file within a support bundle or the failure to collect the data for a single file within a support bundle. A Result may have both a Pathname and an Error if the file written was corrupted or incomplete.

func (*Result) MarshalJSON

func (r *Result) MarshalJSON() ([]byte, error)

Result.Error will be {} if it has no exported fields, so replace it with a string.

func (*Result) UnmarshalJSON

func (r *Result) UnmarshalJSON(raw []byte) error

convert Error from string to error

type RetracedEventsOptions added in v0.3.1

type RetracedEventsOptions struct {
	APIEndpoint string                    `json:"api_endpoint"`
	ProjectID   string                    `json:"project_id,omitempty"`
	APIToken    string                    `json:"api_token,omitempty"`
	Insecure    bool                      `json:"insecure,omitempty"`
	Mask        *retraced.EventNodeMask   `json:"mask,omitempty"`
	Query       *retraced.StructuredQuery `json:"query,omitempty"`
}

type Scrub

type Scrub struct {
	Regex   string `json:"regex"`
	Replace string `json:"replace"`
}

type Spec

type Spec struct {
	ID             string
	Builtin        string
	TimeoutSeconds int
	// paths
	Raw   string
	JSON  string
	Human string

	// Plan-specific config
	Config Config

	// New plan-specific config
	// TODO: new format for all tasks
	DockerRunCommand       *DockerRunCommandOptions       `json:"docker.run-command,omitempty"`
	DockerContainerLogs    *DockerContainerLogsOptions    `json:"docker.container-logs,omitempty"`
	DockerContainerInspect *DockerContainerInspectOptions `json:"docker.container-inspect,omitempty"`
	HTTPRequestCommand     *HTTPRequestCommandOptions     `json:"core.http-request,omitempty"`
	RetracedEventsCommand  *RetracedEventsOptions         `json:"retraced.events,omitempty"`
	JournaldLogs           *JournaldLogs                  `json:"journald.logs,omitempty"`
}

type StreamProducer

type StreamProducer func(context.Context) (io.Reader, error)

type StreamsProducer

type StreamsProducer func(context.Context) (map[string]io.Reader, error)

probably stdout and stderr

type StructuredProducer

type StructuredProducer func(context.Context) (interface{}, error)

type Task

type Task interface {
	Exec(ctx context.Context, rootDir string) []*Result
}

Jump to

Keyboard shortcuts

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