workqueue

package
v0.0.0-...-4958bb2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 18, 2020 License: BSD-2-Clause Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DownloadRecord

type DownloadRecord struct {
	ID        int64  `json:"id"`
	URL       string `json:"url"`
	Subfolder string `json:"subfolder"`
}

DownloadRecord defines the stored download metadata

type Queue

type Queue struct {
	// contains filtered or unexported fields
}

Queue is the interface that defines interacting with Download Records

func NewQueue

func NewQueue(logger *log.Logger, redisHost string, redisPort string, redisNamespace string, pathPrefix string, l listing.Service, u updating.Service) (*Queue, error)

NewQueue returns a new Sql DB storage

func (*Queue) EnqueueDownload

func (q *Queue) EnqueueDownload(dr *adding.DownloadRecord, recordID int64) error

EnqueueDownload enqueues the download

func (*Queue) StartServer

func (q *Queue) StartServer()

StartServer starts listening on configured port

func (*Queue) StartWorkerPool

func (q *Queue) StartWorkerPool()

StartWorkerPool does what it says

func (*Queue) StopServer

func (q *Queue) StopServer()

StopServer stops the httpServer

func (*Queue) StopWorkerPool

func (q *Queue) StopWorkerPool()

StopWorkerPool does what it says

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL