client

package
v0.34.0 Latest Latest
Warning

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

Go to latest
Published: Jul 22, 2020 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 added in v0.8.0

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 added in v0.24.0

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 added in v0.8.0

func SortEnvsByKey(envs []*appb.InfoResponse_EnvVar)

Types

type ByKey added in v0.8.0

type ByKey []*appb.InfoResponse_EnvVar

func (ByKey) Len added in v0.8.0

func (s ByKey) Len() int

func (ByKey) Less added in v0.8.0

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

func (ByKey) Swap added in v0.8.0

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