Skip to content

Commit

Permalink
config: Add QINGSTOR_ENABLE_VIRTUAL_HOST_STYLE env variable (#125)
Browse files Browse the repository at this point in the history
  • Loading branch information
zhaohuxing authored Jan 25, 2021
1 parent 42b0bad commit dee32b4
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
4 changes: 4 additions & 0 deletions config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -266,6 +266,10 @@ func (c *Config) parseEndpoint() error {
func (c *Config) readCredentialFromEnv() (err error) {
c.AccessKeyID = os.Getenv(EnvAccessKeyID)
c.SecretAccessKey = os.Getenv(EnvSecretAccessKey)
c.EnableVirtualHostStyle, err = strconv.ParseBool(os.Getenv(EnvEnableVirtualHostStyle))
if err != nil {
return
}
return nil
}

Expand Down
3 changes: 3 additions & 0 deletions config/contract.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,9 @@ const (

// EnvSecretAccessKey is config envrionment variable.
EnvSecretAccessKey = "QINGSTOR_SECRET_ACCESS_KEY"

// EnvEnableVirtualHostStyle is config envrionment variable.
EnvEnableVirtualHostStyle = "QINGSTOR_ENABLE_VIRTUAL_HOST_STYLE"
)

// GetUserConfigFilePath returns the user config file path.
Expand Down

0 comments on commit dee32b4

Please sign in to comment.