client

package
v0.0.0-...-e218867 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	DefaultConfigFileLocation string
	ErrInvalidConfigFile      = errors.New("Invalid config file")
	ErrInvalidDir             = errors.New("Invalid directory")
)

Functions

func EnsurePasswordLength

func EnsurePasswordLength(pass string) error

func GetErrorMsg

func GetErrorMsg(err error) string

func GetInput

func GetInput(msg string) (string, error)

func GetMaskedPassword

func GetMaskedPassword(prompt string) (string, error)

func New

func New(cfg ClusterConfig) (*grpc.ClientConn, error)

func PrintConnectionErrorAndExit

func PrintConnectionErrorAndExit(err error)

func PrintErrorAndExit

func PrintErrorAndExit(format string, args ...interface{})

func SaveConfigFile

func SaveConfigFile(path string, cfg *Config) error

func SaveToken

func SaveToken(cfgFile, cfgCluster, token string) error

func SortEnvsByKey

func SortEnvsByKey(envs []*appb.InfoResponse_EnvVar)

Types

type ByKey

type ByKey []*appb.InfoResponse_EnvVar

func (ByKey) Len

func (s ByKey) Len() int

func (ByKey) Less

func (s ByKey) Less(i, j int) bool

func (ByKey) Swap

func (s ByKey) Swap(i, j int)

type ClusterConfig

type ClusterConfig struct {
	Server   string `yaml:"server"`
	Token    string `yaml:"token"`
	UseTLS   bool   `yaml:"tls"`
	Insecure bool   `yaml:"insecure"`
}

func GetConfig

func GetConfig(cfgFile, cfgCluster string) (*ClusterConfig, error)

type Config

type Config struct {
	Clusters       map[string]ClusterConfig `yaml:"clusters"`
	CurrentCluster string                   `yaml:"current_cluster"`
}

func ReadConfigFile

func ReadConfigFile(cfgFile string) (*Config, error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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