profile

package
v0.14.1 Latest Latest
Warning

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

Go to latest
Published: Aug 28, 2018 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultProfileName = "default"
View Source
const ProfileDirEnv = "USACLOUD_PROFILE_DIR"

Variables

This section is empty.

Functions

func GetConfigFilePath

func GetConfigFilePath(profileName string) (string, error)

func GetCurrentName

func GetCurrentName() (string, error)

func List

func List() ([]string, error)

func RemoveConfigFile

func RemoveConfigFile(profileName string) error

func SaveConfigFile

func SaveConfigFile(profileName string, val *ConfigFileValue) error

func SetCurrentName

func SetCurrentName(profileName string) error

func ValidateProfileName

func ValidateProfileName(profileName string, invalidRunes ...rune) error

Types

type ConfigFileValue

type ConfigFileValue struct {
	AccessToken       string
	AccessTokenSecret string
	Zone              string
	Timeout           int      `json:",omitempty"`
	AcceptLanguage    string   `json:",omitempty"`
	RetryMax          int      `json:",omitempty"`
	RetryIntervalSec  int64    `json:",omitempty"`
	NoColor           bool     `json:",omitempty"`
	DefaultOutputType string   `json:",omitempty"`
	Zones             []string `json:",omitempty"`
	APIRootURL        string   `json:",omitempty"`
}

func LoadConfigFile

func LoadConfigFile(profileName string) (*ConfigFileValue, error)

func (*ConfigFileValue) IsEmpty

func (p *ConfigFileValue) IsEmpty() bool

Jump to

Keyboard shortcuts

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