add aws apis

This commit is contained in:
Jay
2019-05-02 11:51:48 +08:00
parent 463dd44989
commit 6c69e9871f
8 changed files with 126 additions and 2 deletions
+7 -1
View File
@@ -16,6 +16,7 @@ type Config struct {
Port int `yaml:"port"`
AWS struct {
SharedConfig bool `yaml:"shared_config"`
SharedName string `yaml:"shared_name"`
AccessKey string `yaml:"access_key"`
SecretKey string `yaml:"secret_key"`
} `yaml:"aws"`
@@ -50,7 +51,7 @@ func LoadConfig(p ...string) (err error) {
if err != nil {
return err
}
envOverride()
envOverride()
return
}
@@ -76,6 +77,11 @@ func envOverride() {
}
}
str = os.Getenv("AWS_SHARED_NAME")
if len(str) > 0 {
conf.AWS.SharedName = str
}
// set aws access key
str = os.Getenv("AWS_ACCESS_KEY")
if len(str) > 0 {