{"modulePath":"github.com/mutablelogic/go-server","version":"v1.5.17","isLatest":false,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package schema\n\n## Constants\n\n```go\nconst (\n\tSchemaName       = \"pgqueue\"\n\tDefaultNamespace = \"default\"\n\tCleanupNamespace = \"cleanup\"\n\tAPIPrefix        = \"/queue/v1\"\n\tTopicQueueInsert = \"queue_insert\"\n\tQueueListLimit   = 100\n\tTickerListLimit  = 100\n\tTaskListLimit    = 100\n\tTickerPeriod     = 15 * time.Second\n\tTaskPeriod       = 15 * time.Second\n)\n```\n\n## Functions\n\n```go\nfunc Bootstrap(ctx context.Context, conn pg.Conn) error\n```\n\n## Types\n\n```go\ntype Queue struct {\n\tQueueMeta\n\tNamespace string `json:\"namespace,omitempty\" help:\"Namespace\"`\n}\n```\n\n```go\nfunc (q *Queue) Scan(row pg.Row) error\n```\nQueue\n\n```go\nfunc (q Queue) String() string\n```\n\n```go\ntype QueueCleanRequest struct {\n\tQueue string `json:\"queue,omitempty\" arg:\"\" help:\"Queue name\"`\n}\n```\n\n```go\nfunc (q QueueCleanRequest) Select(bind *pg.Bind, op pg.Op) (string, error)\n```\n\n```go\ntype QueueCleanResponse struct {\n\tBody []Task `json:\"body,omitempty\"`\n}\n```\n\n```go\nfunc (l *QueueCleanResponse) Scan(row pg.Row) error\n```\nQueueCleanResponse\n\n```go\ntype QueueList struct {\n\tQueueListRequest\n\tCount uint64  `json:\"count\"`\n\tBody  []Queue `json:\"body,omitempty\"`\n}\n```\n\n```go\nfunc (l *QueueList) Scan(row pg.Row) error\n```\nQueueList\n\n```go\nfunc (l *QueueList) ScanCount(row pg.Row) error\n```\nQueueListCount\n\n```go\nfunc (q QueueList) String() string\n```\n\n```go\ntype QueueListRequest struct {\n\tpg.OffsetLimit\n}\n```\n\n```go\nfunc (l QueueListRequest) Select(bind *pg.Bind, op pg.Op) (string, error)\n```\n\n```go\ntype QueueMeta struct {\n\tQueue      string         `json:\"queue,omitempty\" arg:\"\" help:\"Queue name\"`\n\tTTL        *time.Duration `json:\"ttl,omitempty\" help:\"Time-to-live for queue messages\"`\n\tRetries    *uint64        `json:\"retries\" help:\"Number of retries before failing\"`\n\tRetryDelay *time.Duration `json:\"retry_delay\" help:\"Backoff delay\"`\n}\n```\n\n```go\nfunc (q QueueMeta) Insert(bind *pg.Bind) (string, error)\n```\nInsert\n\n```go\nfunc (q QueueMeta) String() string\n```\n\n```go\nfunc (q QueueMeta) Update(bind *pg.Bind) error\n```\nPatch\n\n```go\ntype QueueName string\n```\n\n```go\nfunc (q QueueName) Select(bind *pg.Bind, op pg.Op) (string, error)\n```\n\n```go\ntype QueueStatus struct {\n\tQueue  string `json:\"queue\"`\n\tStatus string `json:\"status\"`\n\tCount  uint64 `json:\"count\"`\n}\n```\n\n```go\nfunc (s *QueueStatus) Scan(row pg.Row) error\n```\nQueueStatus\n\n```go\nfunc (q QueueStatus) String() string\n```\n\n```go\ntype QueueStatusRequest struct{}\n```\n\n```go\nfunc (l QueueStatusRequest) Select(bind *pg.Bind, op pg.Op) (string, error)\n```\n\n```go\ntype QueueStatusResponse struct {\n\tBody []QueueStatus `json:\"body,omitempty\"`\n}\n```\n\n```go\nfunc (l *QueueStatusResponse) Scan(row pg.Row) error\n```\nQueueStatusResponse\n\n```go\ntype Task struct {\n\tId uint64 `json:\"id,omitempty\"`\n\tTaskMeta\n\tWorker     *string    `json:\"worker,omitempty\"`\n\tNamespace  string     `json:\"namespace,omitempty\"`\n\tQueue      string     `json:\"queue,omitempty\"`\n\tResult     any        `json:\"result,omitempty\"`\n\tCreatedAt  *time.Time `json:\"created_at,omitempty\"`\n\tStartedAt  *time.Time `json:\"started_at,omitempty\"`\n\tFinishedAt *time.Time `json:\"finished_at,omitempty\"`\n\tDiesAt     *time.Time `json:\"dies_at,omitempty\"`\n\tRetries    *uint64    `json:\"retries,omitempty\"`\n}\n```\n\n```go\nfunc (t *Task) Scan(row pg.Row) error\n```\n\n```go\nfunc (t Task) String() string\n```\n\n```go\ntype TaskId uint64\n```\n\n```go\nfunc (t *TaskId) Scan(row pg.Row) error\n```\n\n```go\nfunc (t TaskId) Select(bind *pg.Bind, op pg.Op) (string, error)\n```\n\n```go\ntype TaskList struct {\n\tTaskListRequest\n\tCount uint64           `json:\"count\"`\n\tBody  []TaskWithStatus `json:\"body,omitempty\"`\n}\n```\n\n```go\nfunc (l *TaskList) Scan(row pg.Row) error\n```\nTaskList\n\n```go\nfunc (l *TaskList) ScanCount(row pg.Row) error\n```\nTaskListCount\n\n```go\nfunc (t TaskList) String() string\n```\n\n```go\ntype TaskListRequest struct {\n\tpg.OffsetLimit\n\tStatus string `json:\"status,omitempty\"`\n}\n```\n\n```go\nfunc (l TaskListRequest) Select(bind *pg.Bind, op pg.Op) (string, error)\n```\n\n```go\ntype TaskMeta struct {\n\tPayload   any        `json:\"payload,omitempty\"`\n\tDelayedAt *time.Time `json:\"delayed_at,omitempty\"`\n}\n```\n\n```go\nfunc (t TaskMeta) Insert(bind *pg.Bind) (string, error)\n```\n\n```go\nfunc (t TaskMeta) String() string\n```\n\n```go\nfunc (t TaskMeta) Update(bind *pg.Bind) error\n```\n\n```go\ntype TaskRelease struct {\n\tId     uint64 `json:\"id,omitempty\"`\n\tFail   bool   `json:\"fail,omitempty\"`\n\tResult any    `json:\"result,omitempty\"`\n}\n```\n\n```go\nfunc (t TaskRelease) Select(bind *pg.Bind, op pg.Op) (string, error)\n```\n\n```go\ntype TaskRetain struct {\n\tWorker string `json:\"worker,omitempty\"`\n}\n```\n\n```go\nfunc (t TaskRetain) Select(bind *pg.Bind, op pg.Op) (string, error)\n```\n\n```go\ntype TaskWithStatus struct {\n\tTask\n\tStatus string `json:\"status,omitempty\"`\n}\n```\n\n```go\nfunc (t *TaskWithStatus) Scan(row pg.Row) error\n```\n\n```go\nfunc (t TaskWithStatus) String() string\n```\n\n```go\ntype Ticker struct {\n\tTickerMeta\n\tNamespace string     `json:\"namespace,omitempty\" help:\"Namespace\"`\n\tTs        *time.Time `json:\"timestamp,omitempty\"`\n}\n```\n\n```go\nfunc (r *Ticker) Scan(row pg.Row) error\n```\n\n```go\nfunc (t Ticker) String() string\n```\n\n```go\ntype TickerList struct {\n\tTickerListRequest\n\tCount uint64   `json:\"count\"`\n\tBody  []Ticker `json:\"body,omitempty\"`\n}\n```\n\n```go\nfunc (l *TickerList) Scan(row pg.Row) error\n```\nTickerList\n\n```go\nfunc (l *TickerList) ScanCount(row pg.Row) error\n```\nTickerListCount\n\n```go\nfunc (t TickerList) String() string\n```\n\n```go\ntype TickerListRequest struct {\n\tpg.OffsetLimit\n}\n```\n\n```go\nfunc (t TickerListRequest) Select(bind *pg.Bind, op pg.Op) (string, error)\n```\n\n```go\ntype TickerMeta struct {\n\tTicker   string         `json:\"ticker\" arg:\"\" help:\"Ticker name\"`\n\tPayload  any            `json:\"payload,omitempty\"`\n\tInterval *time.Duration `json:\"interval,omitempty\" help:\"Interval (default 1 minute)\"`\n}\n```\n\n```go\nfunc (w TickerMeta) Insert(bind *pg.Bind) (string, error)\n```\n\n```go\nfunc (t TickerMeta) String() string\n```\n\n```go\nfunc (w TickerMeta) Update(bind *pg.Bind) error\n```\n\n```go\ntype TickerName string\n```\n\n```go\nfunc (q TickerName) Select(bind *pg.Bind, op pg.Op) (string, error)\n```\n\n```go\ntype TickerNext struct{}\n```\n\n```go\nfunc (t TickerNext) Select(bind *pg.Bind, op pg.Op) (string, error)\n```\n\n","path":"github.com/mutablelogic/go-server/pkg/pgqueue/schema","name":"schema","synopsis":"","isRedistributable":true}
