app

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: May 9, 2022 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	OUTPUT_JSON = "json"
	OUTPUT_YAML = "yaml"
)

Variables

View Source
var (
	BuildVersion string = ""
	BuildTime    string = ""
)

#!/usr/bin/env bash version=0.1.0 go build -ldflags="-X 'github.com/itnpeople/cbctl/app.BuildTime=$(date -u +%FT%T%Z)' -X 'github.com/itnpeople/cbctl/app.BuildVersion=$version'" .

View Source
var (
	Config *conf
)

Functions

func BindCommandArgs added in v0.2.0

func BindCommandArgs(values ...*string) func(c *cobra.Command, args []string) error

func GetBody added in v0.2.0

func GetBody(o IOptions, tpl string) (buf []byte, err error)

func HomeDir added in v0.1.0

func HomeDir() string

func OnConfigInitialize added in v0.1.0

func OnConfigInitialize(cfgFile string) error

func ValidateError

func ValidateError(c *cobra.Command, err error)

Types

type ConfigContext added in v0.1.0

type ConfigContext struct {
	Name      string `yaml:"name"`
	Namespace string `yaml:"namespace"`
	Urls      struct {
		MCKS      string `yaml:"mcks"`
		Spider    string `yaml:"spider"`
		Tumblebug string `yaml:"tumblebug"`
	} `yaml:"urls"`
}

type IOStreams

type IOStreams struct {
	In     *os.File
	Out    *os.File
	ErrOut *os.File
}

type IOptions added in v0.2.0

type IOptions interface {
	GetFilename() string
}

type Options added in v0.2.0

type Options struct {
	OutStream  *os.File // output stream
	ConfigFile string   // config file
	Output     string   // output format (json/yaml)
	Filename   string   // file
	Namespace  string   // cloud-barista namespace
	Name       string   // object name
}

func (*Options) GetFilename added in v0.2.0

func (o *Options) GetFilename() string

func (*Options) Println added in v0.2.0

func (o *Options) Println(format string, params ...interface{})

func (*Options) PrintlnError added in v0.2.0

func (o *Options) PrintlnError(err error)

func (*Options) WriteBody added in v0.2.0

func (o *Options) WriteBody(json []byte)

type Output

type Output struct {
	Type   *string
	Stream *os.File
}

func (*Output) Write

func (self *Output) Write(json []byte)

func (*Output) WriteString added in v0.1.0

func (self *Output) WriteString(format string, params ...interface{})

type OutputType

type OutputType string

Jump to

Keyboard shortcuts

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