config

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Apr 21, 2019 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ConfigDir is the directory to store config file
	ConfigDir string
	// DefaultConfigFile is the default config file name
	DefaultConfigFile string
)

Directories

View Source
var (
	// ErrConfigNotMatch indicates error for no config matchs
	ErrConfigNotMatch = fmt.Errorf("no config matchs")
	// ErrEmptyEndpoint indicates error for empty endpoint
	ErrEmptyEndpoint = fmt.Errorf("no endpoint has been set")
)

Error strings

View Source
var ConfigCmd = &cobra.Command{
	Use:       "config",
	Short:     "Set or get configuration for ioctl",
	ValidArgs: []string{"set", "get"},
	Args:      cobra.MinimumNArgs(1),
}

ConfigCmd represents the config command

Functions

func Get

func Get(arg string) (string, error)

Get gets config variable

Types

type Config

type Config struct {
	Wallet        string            `yaml:"wallet"`
	Endpoint      string            `yaml:"endpoint"`
	SecureConnect bool              `yaml:"secureConnect"`
	Aliases       map[string]string `yaml:"aliases"`
}

Config defines the config schema

var (
	// ReadConfig represents the current config read from local
	ReadConfig Config
	// Insecure represents the insecure connect option of grpc dial, default is false
	Insecure = false
)

func LoadConfig

func LoadConfig() (Config, error)

LoadConfig loads config file in yaml format

Jump to

Keyboard shortcuts

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