schema

package
v1.1.2 Latest Latest
Warning

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

Go to latest
Published: Jan 13, 2026 License: Apache-2.0 Imports: 6 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const (
	SchemaName        = "pgqueue"
	DefaultNamespace  = "default"
	QueueListLimit    = 100
	TickerListLimit   = 100
	TickerPeriod      = 15 * time.Second
	TaskPeriod        = 15 * time.Second
	CleanupTickerName = "cleanup"
	CleanupInterval   = 1 * time.Hour
	TopicQueueInsert  = "_queue_insert" // pg_notify topic suffix for task inserts
)

Variables

This section is empty.

Functions

This section is empty.

Types

type NamespaceList

type NamespaceList struct {
	Count uint64   `json:"count"`
	Body  []string `json:"body,omitempty"`
}

func (*NamespaceList) Scan

func (l *NamespaceList) Scan(row pg.Row) error

func (*NamespaceList) ScanCount

func (l *NamespaceList) ScanCount(row pg.Row) error

func (NamespaceList) String

func (l NamespaceList) String() string

type NamespaceListRequest

type NamespaceListRequest struct{}

func (NamespaceListRequest) Select

func (l NamespaceListRequest) Select(bind *pg.Bind, op pg.Op) (string, error)

type Queue

type Queue struct {
	QueueMeta
	Namespace string `json:"namespace,omitempty" help:"Namespace"`
}

func (*Queue) Scan

func (q *Queue) Scan(row pg.Row) error

Queue

func (Queue) String

func (q Queue) String() string

type QueueCleanRequest

type QueueCleanRequest struct {
	Queue string `json:"queue,omitempty" arg:"" help:"Queue name"`
}

func (QueueCleanRequest) Select

func (q QueueCleanRequest) Select(bind *pg.Bind, op pg.Op) (string, error)

type QueueCleanResponse

type QueueCleanResponse struct {
	Body []Task `json:"body,omitempty"`
}

func (*QueueCleanResponse) Scan

func (l *QueueCleanResponse) Scan(row pg.Row) error

QueueCleanResponse

func (QueueCleanResponse) String

func (q QueueCleanResponse) String() string

type QueueList

type QueueList struct {
	QueueListRequest
	Count uint64  `json:"count"`
	Body  []Queue `json:"body,omitempty"`
}

func (*QueueList) Scan

func (l *QueueList) Scan(row pg.Row) error

QueueList

func (*QueueList) ScanCount

func (l *QueueList) ScanCount(row pg.Row) error

QueueListCount

func (QueueList) String

func (q QueueList) String() string

type QueueListRequest

type QueueListRequest struct {
	pg.OffsetLimit
}

func (QueueListRequest) Select

func (l QueueListRequest) Select(bind *pg.Bind, op pg.Op) (string, error)

type QueueMeta

type QueueMeta struct {
	Queue      string         `json:"queue,omitempty" arg:"" help:"Queue name"`
	TTL        *time.Duration `json:"ttl,omitempty" help:"Time-to-live for queue messages"`
	Retries    *uint64        `json:"retries" help:"Number of retries before failing"`
	RetryDelay *time.Duration `json:"retry_delay" help:"Backoff delay"`
}

func (QueueMeta) Insert

func (q QueueMeta) Insert(bind *pg.Bind) (string, error)

Insert

func (QueueMeta) String

func (q QueueMeta) String() string

func (QueueMeta) Update

func (q QueueMeta) Update(bind *pg.Bind) error

Patch

type QueueName

type QueueName string

func (QueueName) Select

func (q QueueName) Select(bind *pg.Bind, op pg.Op) (string, error)

type QueueStatus

type QueueStatus struct {
	Queue  string `json:"queue"`
	Status string `json:"status"`
	Count  uint64 `json:"count"`
}

func (*QueueStatus) Scan

func (s *QueueStatus) Scan(row pg.Row) error

QueueStatus

func (QueueStatus) String

func (q QueueStatus) String() string

type QueueStatusRequest

type QueueStatusRequest struct{}

func (QueueStatusRequest) Select

func (l QueueStatusRequest) Select(bind *pg.Bind, op pg.Op) (string, error)

type QueueStatusResponse

type QueueStatusResponse struct {
	Body []QueueStatus `json:"body,omitempty"`
}

func (*QueueStatusResponse) Scan

func (l *QueueStatusResponse) Scan(row pg.Row) error

QueueStatusResponse

type Task

type Task struct {
	Id uint64 `json:"id,omitempty"`
	TaskMeta
	Worker     *string    `json:"worker,omitempty"`
	Namespace  string     `json:"namespace,omitempty"`
	Queue      string     `json:"queue,omitempty"`
	Result     any        `json:"result,omitempty"`
	CreatedAt  *time.Time `json:"created_at,omitempty"`
	StartedAt  *time.Time `json:"started_at,omitempty"`
	FinishedAt *time.Time `json:"finished_at,omitempty"`
	DiesAt     *time.Time `json:"dies_at,omitempty"`
	Retries    *uint64    `json:"retries,omitempty"`
}

func (*Task) Scan

func (t *Task) Scan(row pg.Row) error

func (Task) String

func (t Task) String() string

type TaskId

type TaskId uint64

func (*TaskId) Scan

func (t *TaskId) Scan(row pg.Row) error

func (TaskId) Select

func (t TaskId) Select(bind *pg.Bind, op pg.Op) (string, error)

type TaskList

type TaskList struct {
	TaskListRequest
	Count uint64           `json:"count"`
	Body  []TaskWithStatus `json:"body,omitempty"`
}

func (*TaskList) Scan

func (l *TaskList) Scan(row pg.Row) error

TaskList

func (*TaskList) ScanCount

func (l *TaskList) ScanCount(row pg.Row) error

TaskListCount

func (TaskList) String

func (t TaskList) String() string

type TaskListRequest

type TaskListRequest struct {
	pg.OffsetLimit
	Status string `json:"status,omitempty"`
}

func (TaskListRequest) Select

func (l TaskListRequest) Select(bind *pg.Bind, op pg.Op) (string, error)

type TaskMeta

type TaskMeta struct {
	Payload   json.RawMessage `json:"payload,omitempty"`
	DelayedAt *time.Time      `json:"delayed_at,omitempty"`
}

func (TaskMeta) Insert

func (t TaskMeta) Insert(bind *pg.Bind) (string, error)

func (TaskMeta) String

func (t TaskMeta) String() string

func (TaskMeta) Update

func (t TaskMeta) Update(bind *pg.Bind) error

type TaskRelease

type TaskRelease struct {
	Id     uint64 `json:"id,omitempty"`
	Fail   bool   `json:"fail,omitempty"`
	Result any    `json:"result,omitempty"`
}

func (TaskRelease) Select

func (t TaskRelease) Select(bind *pg.Bind, op pg.Op) (string, error)

type TaskRetain

type TaskRetain struct {
	Queues []string `json:"queues,omitempty"`
	Worker string   `json:"worker,omitempty"`
}

func (TaskRetain) Select

func (t TaskRetain) Select(bind *pg.Bind, op pg.Op) (string, error)

type TaskWithStatus

type TaskWithStatus struct {
	Task
	Status string `json:"status,omitempty"`
}

func (*TaskWithStatus) Scan

func (t *TaskWithStatus) Scan(row pg.Row) error

func (TaskWithStatus) String

func (t TaskWithStatus) String() string

type Ticker

type Ticker struct {
	TickerMeta
	Namespace string     `json:"namespace,omitempty" help:"Namespace"`
	Ts        *time.Time `json:"timestamp,omitempty"`
}

func (*Ticker) Scan

func (r *Ticker) Scan(row pg.Row) error

func (Ticker) String

func (t Ticker) String() string

type TickerList

type TickerList struct {
	TickerListRequest
	Count uint64   `json:"count"`
	Body  []Ticker `json:"body,omitempty"`
}

func (*TickerList) Scan

func (l *TickerList) Scan(row pg.Row) error

TickerList

func (*TickerList) ScanCount

func (l *TickerList) ScanCount(row pg.Row) error

TickerListCount

func (TickerList) String

func (t TickerList) String() string

type TickerListRequest

type TickerListRequest struct {
	pg.OffsetLimit
}

func (TickerListRequest) Select

func (t TickerListRequest) Select(bind *pg.Bind, op pg.Op) (string, error)

type TickerMeta

type TickerMeta struct {
	Ticker   string          `json:"ticker" arg:"" help:"Ticker name"`
	Payload  json.RawMessage `json:"payload,omitempty"`
	Interval *time.Duration  `json:"interval,omitempty" help:"Interval (default 1 minute)"`
}

func (TickerMeta) Insert

func (w TickerMeta) Insert(bind *pg.Bind) (string, error)

func (TickerMeta) String

func (t TickerMeta) String() string

func (TickerMeta) Update

func (w TickerMeta) Update(bind *pg.Bind) error

type TickerName

type TickerName string

func (TickerName) Select

func (q TickerName) Select(bind *pg.Bind, op pg.Op) (string, error)

type TickerNext

type TickerNext struct{}

func (TickerNext) Select

func (t TickerNext) Select(bind *pg.Bind, op pg.Op) (string, error)

Jump to

Keyboard shortcuts

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