summaryrefslogtreecommitdiff
path: root/aws.go
diff options
context:
space:
mode:
authorNick White <git@njw.name>2021-07-12 16:47:09 +0100
committerNick White <git@njw.name>2021-07-12 16:47:09 +0100
commitb8533faf24f2bf5247f28848459f9b7af77e61b3 (patch)
treeddfc1e1382f3baf3b8f84a61281056746fec48a5 /aws.go
parent72e7949b8ce84bb0742b977c3827fda6ca0a752e (diff)
Add test for upAndQueue function
This involved adding a test queue, so it can be run safely without intefering with the pipeline.
Diffstat (limited to 'aws.go')
-rw-r--r--aws.go16
1 files changed, 15 insertions, 1 deletions
diff --git a/aws.go b/aws.go
index 65671fa..6e0d7f8 100644
--- a/aws.go
+++ b/aws.go
@@ -51,6 +51,7 @@ type AwsConn struct {
downloader *s3manager.Downloader
uploader *s3manager.Uploader
wipequrl, prequrl, ocrpgqurl, analysequrl string
+ testqurl string
wipstorageid string
}
@@ -125,6 +126,15 @@ func (a *AwsConn) Init() error {
}
a.analysequrl = *result.QueueUrl
+ a.Logger.Println("Getting test queue URL")
+ result, err = a.sqssvc.GetQueueUrl(&sqs.GetQueueUrlInput{
+ QueueName: aws.String(queueTest),
+ })
+ if err != nil {
+ return errors.New(fmt.Sprintf("Error getting test queue URL: %s", err))
+ }
+ a.testqurl = *result.QueueUrl
+
return nil
}
@@ -336,6 +346,10 @@ func (a *AwsConn) WIPStorageId() string {
return a.wipstorageid
}
+func (a *AwsConn) TestQueueId() string {
+ return a.testqurl
+}
+
func (a *AwsConn) ListObjects(bucket string, prefix string) ([]string, error) {
var names []string
err := a.s3svc.ListObjectsV2Pages(&s3.ListObjectsV2Input{
@@ -595,7 +609,7 @@ func (a *AwsConn) Log(v ...interface{}) {
// TODO: also set up the necessary security group and iam stuff
func (a *AwsConn) MkPipeline() error {
buckets := []string{storageWip}
- queues := []string{queuePreProc, queueWipeOnly, queueAnalyse, queueOcrPage}
+ queues := []string{queuePreProc, queueWipeOnly, queueAnalyse, queueOcrPage, queueTest}
for _, bucket := range buckets {
err := a.CreateBucket(bucket)