command

package
v0.3.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Execute

func Execute(opts ...CommandOption) error

Execute adds all child commands to the root command and sets flags appropriately. This is called by main.main(). It only needs to happen once to the rootCmd.

func NewMeta

func NewMeta(conf Config, opts ...MetaOption) *cobra.Command

func NewTail

func NewTail(conf Config, opts ...TailOption) *cobra.Command

Types

type Command

type Command interface {
	SetOutput(io.Writer)
}

type CommandOption

type CommandOption func(c Command)

func WithOutput

func WithOutput(out io.Writer) CommandOption

type Config

type Config struct {
	Addr     string `yaml:"addr" env:"LOG_CACHE_ADDR"`
	SkipAuth bool   `yaml:"skip_auth" env:"LOG_CACHE_SKIP_AUTH"`
}

func BuildConfig

func BuildConfig() (Config, error)

BuildConfig reads in config file and ENV variables if set and returns a config object.

type Meta

type Meta struct {
	*cobra.Command
	// contains filtered or unexported fields
}

type MetaOption

type MetaOption func(*Meta)

func WithMetaNoHeaders

func WithMetaNoHeaders() MetaOption

func WithMetaTimeout

func WithMetaTimeout(d time.Duration) MetaOption

type Tail

type Tail struct {
	*cobra.Command
	// contains filtered or unexported fields
}

type TailOption

type TailOption func(*Tail)

func WithTailNoHeaders

func WithTailNoHeaders() TailOption

func WithTailTimeout

func WithTailTimeout(d time.Duration) TailOption

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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