summaryrefslogtreecommitdiff
path: root/cmd/booktopipeline/main.go
diff options
context:
space:
mode:
authorNick White <git@njw.name>2020-05-26 16:03:17 +0100
committerNick White <git@njw.name>2020-05-26 16:03:17 +0100
commit870fb0f3e01a0771d3839da2461e0cec30282bc0 (patch)
treec8f461ba1b829ce4d91d6eb90fd7d34f1e086845 /cmd/booktopipeline/main.go
parent3d2bdd1d30ec6d43b4921d29d5a8338d65c48a5a (diff)
parentebc27eef77868fa44daed7cfb0ea129690029da8 (diff)
Merge branch 'local'
Diffstat (limited to 'cmd/booktopipeline/main.go')
-rw-r--r--cmd/booktopipeline/main.go12
1 files changed, 10 insertions, 2 deletions
diff --git a/cmd/booktopipeline/main.go b/cmd/booktopipeline/main.go
index 2e7064e..609c3b3 100644
--- a/cmd/booktopipeline/main.go
+++ b/cmd/booktopipeline/main.go
@@ -16,7 +16,7 @@ import (
"rescribe.xyz/bookpipeline"
)
-const usage = `Usage: booktopipeline [-t training] [-prebinarised] [-v] bookdir [bookname]
+const usage = `Usage: booktopipeline [-c conn] [-t training] [-prebinarised] [-v] bookdir [bookname]
Uploads the book in bookdir to the S3 'inprogress' bucket and adds it
to the 'preprocess' SQS queue, or the 'wipeonly' queue if the
@@ -57,6 +57,7 @@ func (f fileWalk) Walk(path string, info os.FileInfo, err error) error {
func main() {
verbose := flag.Bool("v", false, "Verbose")
+ conntype := flag.String("c", "aws", "connection type ('aws' or 'local')")
wipeonly := flag.Bool("prebinarised", false, "Prebinarised: only preprocessing will be to wipe")
training := flag.String("t", "", "Training to use (training filename without the .traineddata part)")
@@ -86,7 +87,14 @@ func main() {
}
var conn Pipeliner
- conn = &bookpipeline.AwsConn{Region: "eu-west-2", Logger: verboselog}
+ switch *conntype {
+ case "aws":
+ conn = &bookpipeline.AwsConn{Region: "eu-west-2", Logger: verboselog}
+ case "local":
+ conn = &bookpipeline.LocalConn{Logger: verboselog}
+ default:
+ log.Fatalln("Unknown connection type")
+ }
err := conn.Init()
if err != nil {
log.Fatalln("Failed to set up cloud connection:", err)