summaryrefslogtreecommitdiff
path: root/aws.go
diff options
context:
space:
mode:
authorNick White <git@njw.name>2020-04-14 11:07:07 +0100
committerNick White <git@njw.name>2020-04-14 11:07:07 +0100
commitb4849ccab46cf3f55f109436153e45a175888792 (patch)
treef849a60b84bec7e9d8b49a73be1d5f635589df11 /aws.go
parentdacb5cf28e3ede3b9f1bbf2d9d80b5a9d0d1bc56 (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.go11
1 files changed, 7 insertions, 4 deletions
diff --git a/aws.go b/aws.go
index 70189ea..59f1a7e 100644
--- a/aws.go
+++ b/aws.go
@@ -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