Documentation ¶
Index ¶
Constants ¶
const DefaultConfigFile = "~/.qingstor/config.yaml"
DefaultConfigFile is the filename of default config file.
const DefaultConfigFileContent = `` /* 310-byte string literal not displayed */
DefaultConfigFileContent is the content of default config file.
Variables ¶
This section is empty.
Functions ¶
func GetUserConfigFilePath ¶
func GetUserConfigFilePath() string
GetUserConfigFilePath returns the user config file path.
func InstallDefaultUserConfig ¶
func InstallDefaultUserConfig() error
InstallDefaultUserConfig will install default config file.
Types ¶
type Config ¶
type Config struct { AccessKeyID string `yaml:"access_key_id"` SecretAccessKey string `yaml:"secret_access_key"` Host string `yaml:"host"` Port int `yaml:"port"` Protocol string `yaml:"protocol"` ConnectionRetries int `yaml:"connection_retries"` AdditionalUserAgent string `yaml:"additional_user_agent"` LogLevel string `yaml:"log_level"` Connection *http.Client }
A Config stores a configuration of this sdk.
func NewDefault ¶
NewDefault create a Config with default configuration.
func (*Config) LoadConfigFromContent ¶
LoadConfigFromContent loads configuration from a given byte slice. It returns error if yaml decode failed.
func (*Config) LoadConfigFromFilePath ¶
LoadConfigFromFilePath loads configuration from a specified local path. It returns error if file not found or yaml decode failed.
func (*Config) LoadDefaultConfig ¶
LoadDefaultConfig loads the default configuration for Config. It returns error if yaml decode failed.
func (*Config) LoadUserConfig ¶
LoadUserConfig loads user configuration in ~/.qingstor/config.yaml for Config. It returns error if file not found.