diff options
author | Nick White <git@njw.name> | 2021-07-19 12:32:03 +0100 |
---|---|---|
committer | Nick White <git@njw.name> | 2021-07-19 12:32:03 +0100 |
commit | 315493955b2cef01681d10a1244d1025fed8d50a (patch) | |
tree | 94a1ac5f11265d56d14a6e62da606193c76fa61d /internal/pipeline | |
parent | 8c98574edd21759f1882d0ec4240f562039913fd (diff) |
internal/pipeline: Be more explicit with exactly what functions are in each interface, to ensure no "duplicate function" errors when compiling
Diffstat (limited to 'internal/pipeline')
-rw-r--r-- | internal/pipeline/pipeline.go | 63 |
1 files changed, 39 insertions, 24 deletions
diff --git a/internal/pipeline/pipeline.go b/internal/pipeline/pipeline.go index abf3a08..e1a2c40 100644 --- a/internal/pipeline/pipeline.go +++ b/internal/pipeline/pipeline.go @@ -30,31 +30,47 @@ import ( const HeartbeatSeconds = 60 -type Logger interface { - GetLogger() *log.Logger - Log(v ...interface{}) -} - type Lister interface { - Logger ListObjects(bucket string, prefix string) ([]string, error) + Log(v ...interface{}) WIPStorageId() string } type Downloader interface { - Logger Download(bucket string, key string, fn string) error + Log(v ...interface{}) + WIPStorageId() string +} + +type DownloadLister interface { + Download(bucket string, key string, fn string) error + ListObjects(bucket string, prefix string) ([]string, error) + Log(v ...interface{}) WIPStorageId() string } type Uploader interface { - Logger + Log(v ...interface{}) Upload(bucket string, key string, path string) error WIPStorageId() string } type Queuer interface { - Logger + AddToQueue(url string, msg string) error + AnalyseQueueId() string + CheckQueue(url string, timeout int64) (bookpipeline.Qmsg, error) + DelFromQueue(url string, handle string) error + Log(v ...interface{}) + OCRPageQueueId() string + PreQueueId() string + QueueHeartbeat(msg bookpipeline.Qmsg, qurl string, duration int64) (bookpipeline.Qmsg, error) + WipeQueueId() string +} + +type UploadQueuer interface { + Log(v ...interface{}) + Upload(bucket string, key string, path string) error + WIPStorageId() string PreQueueId() string WipeQueueId() string OCRPageQueueId() string @@ -65,23 +81,22 @@ type Queuer interface { QueueHeartbeat(msg bookpipeline.Qmsg, qurl string, duration int64) (bookpipeline.Qmsg, error) } -type UploadQueuer interface { - Uploader - Queuer -} - -type DownloadLister interface { - Downloader - Lister -} - type Pipeliner interface { + AddToQueue(url string, msg string) error + AnalyseQueueId() string + CheckQueue(url string, timeout int64) (bookpipeline.Qmsg, error) + DelFromQueue(url string, handle string) error + Download(bucket string, key string, fn string) error + GetLogger() *log.Logger Init() error - Logger - Lister - Downloader - Uploader - Queuer + ListObjects(bucket string, prefix string) ([]string, error) + Log(v ...interface{}) + OCRPageQueueId() string + PreQueueId() string + QueueHeartbeat(msg bookpipeline.Qmsg, qurl string, duration int64) (bookpipeline.Qmsg, error) + Upload(bucket string, key string, path string) error + WipeQueueId() string + WIPStorageId() string } type MinPipeliner interface { |