Documentation
¶
Overview ¶
Package queue provides queue implementations that can be used for asynchronous scheduling of fetch actions.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type GCP ¶
type GCP struct {
// contains filtered or unexported fields
}
GCP provides a Queue implementation backed by the Google Cloud Tasks API.
func (*GCP) EnqueueScan ¶
EnqueueScan enqueues a scan task on GCP. It returns an error if there was an error hashing the task name, or an error pushing the task to GCP. If the task was a duplicate, it returns (false, nil).
type InMemory ¶
type InMemory struct {
// contains filtered or unexported fields
}
InMemory is a Queue implementation that schedules in-process fetch operations. Unlike the GCP task queue, it will not automatically retry tasks on failure.
This should only be used for local development.
func NewInMemory ¶
NewInMemory creates a new InMemory that asynchronously fetches from proxyClient and stores in db. It uses workerCount parallelism to execute these fetches.
func (*InMemory) EnqueueScan ¶
EnqueueScan pushes a scan task into the local queue to be processed asynchronously.
func (*InMemory) WaitForTesting ¶
WaitForTesting waits for all queued requests to finish. It should only be used by test code.
type Options ¶
type Options struct { // Namespace prefixes the URL path. Namespace string // DisableProxyFetch reports whether proxyfetch should be set to off when // making a fetch request. DisableProxyFetch bool // TaskNameSuffix is appended to the task name to force reprocessing of // tasks that would normally be de-duplicated. TaskNameSuffix string }
Options is used to provide option arguments for a task queue.