config

package
v0.5.0-rc4-hotfix Latest Latest
Warning

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

Go to latest
Published: Mar 16, 2019 License: Apache-2.0 Imports: 5 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 = "no config matchs"
	// ErrEmptyEndpoint indicates error for empty endpoint
	ErrEmptyEndpoint = "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

Get gets config variable

Types

type Config

type Config struct {
	Endpoint    string            `yaml:"endpoint"`
	Wallet      string            `yaml:"wallet"`
	AccountList map[string]string `yaml:"accountList"`
}

Config defines the config schema

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