app

package
v0.7.2 Latest Latest
Warning

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

Go to latest
Published: Dec 28, 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 (
	Config *conf
)

Functions

func BindCommandArgs

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

func GetBody

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

func HomeDir

func HomeDir() string

func OnConfigInitialize

func OnConfigInitialize(cfgFile string) error

func ValidateError

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

Types

type CliConfig

type CliConfig struct {
	ServerAddr string `yaml:"server_addr"`
	Timeout    string `yaml:"timeout"`
	Tls        struct {
		TlsCa string `yaml:"tls_ca"`
	} `yaml:"tls"`
	Interceptors struct {
		AuthJwt struct {
			JwtToken string `yaml:"jwt_token"`
		} `yaml:"auth_jwt"`
		Opentracing struct {
			Jaeger struct {
				Endpoint    string `yaml:"endpoint"`
				ServiceName string `yaml:"service_name"`
				SampleRate  string `yaml:"sample_rate"`
			} `yaml:"jaeger"`
		} `yaml:"opentracing"`
	} `yaml:"interceptors"`
}

type ConfigContext

type ConfigContext struct {
	Name       string `yaml:"name"`
	Namespace  string `yaml:"namespace"`
	Ladybugcli *CliConfig
	Spidercli  *CliConfig
}

type IOStreams

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

type IOptions

type IOptions interface {
	GetFilename() string
	GetData() string
}

type Options

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

func (*Options) GetData

func (o *Options) GetData() string

func (*Options) GetFilename

func (o *Options) GetFilename() string

func (*Options) Println

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

func (*Options) PrintlnError

func (o *Options) PrintlnError(err error)

func (*Options) WriteBody

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

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