cli

package
v1.0.10 Latest Latest
Warning

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

Go to latest
Published: Dec 26, 2017 License: MPL-2.0 Imports: 15 Imported by: 2

Documentation

Index

Constants

View Source
const (
	ConfigFileName = "config.yml" // our yaml-based config file name

	// v2 base
	ProductionBaseApiUrl       = "https://api.mobingi.com"            // production API base url
	ProductionBaseRegistryUrl  = "https://registry.mobingi.com"       // production Docker Registry base url
	TestBaseApiUrl             = "https://apiqa.mobingi.com"          // test API base url
	TestBaseRegistryUrl        = ProductionBaseRegistryUrl            // test Docker Registry base url
	DevelopmentBaseApiUrl      = "https://apidev.mobingi.com"         // dev API base url
	DevelopmentBaseRegistryUrl = "https://dockereg2.labs.mobingi.com" // dev Docker Registry base url

	// v3 base
	AlmBaseApiUrl       = "https://alm.mobingi.com"              // production API base url for ALM
	WaveBaseApiUrl      = "https://wave.mobingi.com"             // production API base url for Wave
	Sesha3BaseApiUrl    = "https://sesha3.mobingi.com"           // production API base url for sesha3
	AlmDevBaseApiUrl    = "https://almdev.mobingi.com"           // dev API base url for ALM
	WaveDevBaseApiUrl   = "https://wavedev.mobingi.com"          // dev API base url for Wave
	Sesha3DevBaseApiUrl = "https://sesha3.demo.labs.mobingi.com" // dev API base url for sesha3
	AlmTestBaseApiUrl   = "https://almqa.mobingi.com"            // test API base url for ALM
	WaveTestBaseApiUrl  = "https://waveqamobingi.com"            // test API base url for Wave

	ApiVersion       = "v3" // Mobingi API version
	DockerApiVersion = "v2" // Docker API version
)

Variables

View Source
var (
	CliUrl   = "https://api.mobingi.com"
	CliLabel = "mobingi-cli"
)
View Source
var Debug bool
View Source
var Verbose bool

Functions

func ErrorExit added in v1.0.2

func ErrorExit(err interface{}, code int)

func GetCliInt64Flag

func GetCliInt64Flag(cmd *cobra.Command, f string) int64

func GetCliIntFlag

func GetCliIntFlag(cmd *cobra.Command, f string) int

func GetCliStringFlag

func GetCliStringFlag(cmd *cobra.Command, f string) string

func SetDefaultCliConfig

func SetDefaultCliConfig() error

Types

type CliConfig

type CliConfig struct {
	AccessToken     string `yaml:"access_token"`
	BaseApiUrl      string `yaml:"api_url"`
	BaseRegistryUrl string `yaml:"registry_url"`
	BaseSesha3Url   string `yaml:"sesha3_url"`
	ApiVersion      string `yaml:"api_version"`
	Indent          int    `yaml:"indent"`
	Timeout         int64  `yaml:"timeout"`
	Verbose         bool   `yaml:"verbose"`
	Debug           bool   `yaml:"debug"`
}

CliConfig is the object representation of our config file. The field tags for YAML marshaling and unmarshaling match the defined cli constants with prefix 'Config'.

func ReadCliConfig

func ReadCliConfig() *CliConfig

func (*CliConfig) ConfigDir

func (c *CliConfig) ConfigDir() string

func (*CliConfig) ConfigFile

func (c *CliConfig) ConfigFile() string

func (*CliConfig) Reload

func (c *CliConfig) Reload() error

func (*CliConfig) WriteToConfig

func (c *CliConfig) WriteToConfig() error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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