We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent a0d4d1f commit 30d16e6Copy full SHA for 30d16e6
1 file changed
config.go
@@ -6,7 +6,6 @@ import (
6
"os"
7
8
"github.com/akerl/go-lambda/s3"
9
- "github.com/ghodss/yaml"
10
)
11
12
type configFile struct {
@@ -23,19 +22,7 @@ type configFile struct {
23
22
24
func loadConfig() (*configFile, error) {
25
c := configFile{}
26
-
27
- bucket := os.Getenv("S3_BUCKET")
28
- path := os.Getenv("S3_KEY")
29
- if bucket == "" || path == "" {
30
- return &c, fmt.Errorf("config location not provided")
31
- }
32
33
- obj, err := s3.GetObject(bucket, path)
34
- if err != nil {
35
- return &c, err
36
37
38
- err = yaml.Unmarshal(obj, &c)
+ err := s3.GetConfigFromEnv(&c)
39
if err != nil {
40
return &c, err
41
}
0 commit comments