client

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Aug 23, 2017 License: Apache-2.0 Imports: 15 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 GetMaskedPassword

func GetMaskedPassword(prompt string) (string, error)

func New

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

func PrintErrorAndExit

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

func SaveConfigFile

func SaveConfigFile(path string, cfg *Config) error

func SaveToken

func SaveToken(cfgFile, token string) error

Types

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 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