diff options
| author | Dave Henderson <dhenderson@gmail.com> | 2018-08-21 22:22:00 -0400 |
|---|---|---|
| committer | Dave Henderson <dhenderson@gmail.com> | 2018-08-21 23:06:10 -0400 |
| commit | 0e79af96f4013d8f1d842b7dac04879a062ed37a (patch) | |
| tree | 6136c68760649e0ee428903ff83c53f2b2569e22 /data/datasource_awssmp.go | |
| parent | 4e0bb2579fa6f6d8b04356b170198f1a212ab0ff (diff) | |
Unexporting things that were never meant to be exported...
Signed-off-by: Dave Henderson <dhenderson@gmail.com>
Diffstat (limited to 'data/datasource_awssmp.go')
| -rw-r--r-- | data/datasource_awssmp.go | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/data/datasource_awssmp.go b/data/datasource_awssmp.go index 7002180e..4fff2b2e 100644 --- a/data/datasource_awssmp.go +++ b/data/datasource_awssmp.go @@ -10,6 +10,11 @@ import ( gaws "github.com/hairyhenderson/gomplate/aws" ) +// awssmpGetter - A subset of SSM API for use in unit testing +type awssmpGetter interface { + GetParameter(*ssm.GetParameterInput) (*ssm.GetParameterOutput, error) +} + func parseAWSSMPArgs(origPath string, args ...string) (paramPath string, err error) { paramPath = origPath if len(args) >= 1 { @@ -23,8 +28,8 @@ func parseAWSSMPArgs(origPath string, args ...string) (paramPath string, err err } func readAWSSMP(source *Source, args ...string) (output []byte, err error) { - if source.ASMPG == nil { - source.ASMPG = ssm.New(gaws.SDKSession()) + if source.asmpg == nil { + source.asmpg = ssm.New(gaws.SDKSession()) } paramPath, err := parseAWSSMPArgs(source.URL.Path, args...) @@ -32,7 +37,7 @@ func readAWSSMP(source *Source, args ...string) (output []byte, err error) { return nil, err } - source.Type = jsonMimetype + source.mediaType = jsonMimetype return readAWSSMPParam(source, paramPath) } @@ -42,7 +47,7 @@ func readAWSSMPParam(source *Source, paramPath string) ([]byte, error) { WithDecryption: aws.Bool(true), } - response, err := source.ASMPG.GetParameter(input) + response, err := source.asmpg.GetParameter(input) if err != nil { return nil, errors.Wrapf(err, "Error reading aws+smp from AWS using GetParameter with input %v", input) |
