package
3.7.0
Repository: https://github.com/contiamo/go-base.git
Documentation: pkg.go.dev

# Packages

No description provided by the author
No description provided by the author
No description provided by the author

# Functions

DequeuerWithMetrics returns q wrapped with the standard metrics implementation.
QueuerWithMetrics returns q wrapped with the standard metrics implementation.
SchedulerWithMetrics returns q wrapped with the standard metrics implementation.
SwitchMetricsServiceName changes the service label used in the metrics, so it can be customized with a different name.

# Constants

Cancelled task is canceled by the user nolint: misspell // the initial spelling was with double 'l' now we have to stick with it.
Failed task is failed with an error.
Finished task is successfully finished.
Running task is currently running.
Waiting task is waiting for being picked up.

# Variables

ErrNotScheduled indicates the current scheduled task is has not been created yet.
ErrTaskCancelled is used to notify the worker from the Heartbeat that the task was canceled by the user and it needs to stop working on it.
ErrTaskFailed indicates that a task has failed and should not be restarted.
ErrTaskFinished is used to notify the worker from the Heartbeat that the task has already finished and can't be worked on.
ErrTaskNotFound is used to notify the worker from the Heartbeat that the task does not exist.
ErrTaskNotRunning is used to notify the worker from the Heartbeat that the task has not started yet and can't be worked on.
ErrTaskQueueNotSpecified indicates that the given task cannot be enqueued because the queue name is empty.
ErrTaskTypeNotSpecified indicates that the given task cannot be enqueued because the task type is empty.
SchedulerMetrics is the global metrics instance for the scheduler of this instance.
ScheduleWorkerMetrics is the global metrics instance for the schedule worker of this instance.
TaskQueueMetrics is the global metrics instance for the task queue of this instance.
TaskWorkerMetrics is the global metrics instance for the task worker of this instance.

# Structs

QueueMock implements queue with very simple counters for testing.
TaskQueueMetricsType provides access to the prometheus metric objects for the scheduler.
SchedulerMock implement scheduler with very simple counters for testing.
ScheduleWorkerMetricsType provides access to the prometheus metric objects for a schedule worker.
Task represents a task in the queue.
TaskBase contains basic fields for a task.
TaskEnqueueRequest contains fields required for adding a task to the queue.
TaskQueueMetricsType provides access to the prometheus metric objects for the task queue.
TaskScheduleRequest contains fields required for scheduling a task.
WorkerMetricsType provides access to the prometheus metric objects for a worker.

# Interfaces

Dequeuer is a read only interface for the queue.
Queuer is a write-only interface for the queue.
Scheduler defines how one schedules a task.
TaskHandler is a type alias for a method that parses a task and returns any processing errors.
Worker provides methods to do some kind of work.

# Type aliases

Progress is a serialized status object that indicates the status of the task For example, it can be an object that contains the amount of processed bytes.
References is a dictionary of additinal SQL columns to set.
Spec is is a serialized specification object used to set the task parameters.
TaskHandlerFunc is an adapter that allows the use of a normal function as a TaskHandler.
TaskStatus : Current state of the task.
TaskType is a type which specifies what a task it is.