diff options
author | Nick White <git@njw.name> | 2020-04-14 11:07:07 +0100 |
---|---|---|
committer | Nick White <git@njw.name> | 2020-04-14 11:07:07 +0100 |
commit | b4849ccab46cf3f55f109436153e45a175888792 (patch) | |
tree | f849a60b84bec7e9d8b49a73be1d5f635589df11 /aws.go | |
parent | dacb5cf28e3ede3b9f1bbf2d9d80b5a9d0d1bc56 (diff) |
Remove unused PreprocPattern, allow sensible defaults with aws setup, and add a little more documentation
Diffstat (limited to 'aws.go')
-rw-r--r-- | aws.go | 11 |
1 files changed, 7 insertions, 4 deletions
@@ -20,7 +20,7 @@ import ( "github.com/aws/aws-sdk-go/service/sqs" ) -const PreprocPattern = `_bin[0-9].[0-9].png` +const defaultAwsRegion = `eu-west-2` type Qmsg struct { Id, Handle, Body string @@ -35,8 +35,11 @@ type ObjMeta struct { Date time.Time } +// AwsConn contains the necessary things to interact with various AWS +// services in ways useful for the bookpipeline package. It is +// designed to be generic enough to swap in other backends easily. type AwsConn struct { - // these need to be set before running Init() + // these should be set before running Init(), or left to defaults Region string Logger *log.Logger @@ -53,10 +56,10 @@ type AwsConn struct { // MinimalInit does the bare minimum to initialise aws services func (a *AwsConn) MinimalInit() error { if a.Region == "" { - return errors.New("No Region set") + a.Region = defaultAwsRegion } if a.Logger == nil { - return errors.New("No logger set") + a.Logger = log.New(os.Stdout, "", 0) } var err error |