sidecar

package
v0.0.0-...-81934b1 Latest Latest
Warning

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

Go to latest
Published: Jan 17, 2019 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Overview

Package sidecar is a library that knows how to report on the output of a process that writes its output and exit code to disk

Index

Constants

View Source
const (
	// JSONConfigEnvVar is the environment variable that
	// utilities expect to find a full JSON configuration
	// in when run.
	JSONConfigEnvVar = "SIDECAR_OPTIONS"
)

Variables

This section is empty.

Functions

func Encode

func Encode(options Options) (string, error)

Encode will encode the set of options in the format that is expected for the configuration environment variable

Types

type Options

type Options struct {
	GcsOptions     *gcsupload.Options `json:"gcs_options"`
	WrapperOptions *wrapper.Options   `json:"wrapper_options,omitempty"`

	// Additional entries to wait for if set
	Entries []wrapper.Options `json:"entries,omitempty"`
}

Options exposes the configuration necessary for defining the process being watched and where in GCS an upload will land.

func NewOptions

func NewOptions() *Options

NewOptions returns an empty Options with no nil fields

func (*Options) AddFlags

func (o *Options) AddFlags(flags *flag.FlagSet)

AddFlags binds flags to options

func (*Options) Complete

func (o *Options) Complete(args []string)

Complete internalizes command line arguments

func (*Options) ConfigVar

func (o *Options) ConfigVar() string

ConfigVar exposese the environment variable used to store serialized configuration

func (*Options) LoadConfig

func (o *Options) LoadConfig(config string) error

LoadConfig loads options from serialized config

func (Options) Run

func (o Options) Run(ctx context.Context) error

Run will watch for the process being wrapped to exit and then post the status of that process and any artifacts to cloud storage.

func (*Options) Validate

func (o *Options) Validate() error

Validate ensures that the set of options are self-consistent and valid

Jump to

Keyboard shortcuts

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