Documentation
¶
Index ¶
- Constants
- func Bootstrap(ctx context.Context, conn pg.Conn) error
- type Queue
- type QueueCleanRequest
- type QueueCleanResponse
- type QueueList
- type QueueListRequest
- type QueueMeta
- type QueueName
- type QueueStatus
- type QueueStatusRequest
- type QueueStatusResponse
- type Task
- type TaskId
- type TaskList
- type TaskListRequest
- type TaskMeta
- type TaskRelease
- type TaskRetain
- type TaskWithStatus
- type Ticker
- type TickerList
- type TickerListRequest
- type TickerMeta
- type TickerName
- type TickerNext
Constants ¶
View Source
const ( SchemaName = "pgqueue" DefaultNamespace = "default" CleanupNamespace = "cleanup" APIPrefix = "/queue/v1" TopicQueueInsert = "queue_insert" QueueListLimit = 100 TickerListLimit = 100 TaskListLimit = 100 TickerPeriod = 15 * time.Second TaskPeriod = 15 * time.Second )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type QueueCleanRequest ¶
type QueueCleanRequest struct {
Queue string `json:"queue,omitempty" arg:"" help:"Queue name"`
}
type QueueCleanResponse ¶
type QueueCleanResponse struct {
Body []Task `json:"body,omitempty"`
}
type QueueList ¶
type QueueList struct { QueueListRequest Count uint64 `json:"count"` Body []Queue `json:"body,omitempty"` }
type QueueListRequest ¶
type QueueListRequest struct {
pg.OffsetLimit
}
type QueueMeta ¶ added in v1.5.6
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"` }
type QueueStatus ¶
type QueueStatus struct { Queue string `json:"queue"` Status string `json:"status"` Count uint64 `json:"count"` }
func (QueueStatus) String ¶
func (q QueueStatus) String() string
type QueueStatusRequest ¶
type QueueStatusRequest struct{}
type QueueStatusResponse ¶
type QueueStatusResponse struct {
Body []QueueStatus `json:"body,omitempty"`
}
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"` }
type TaskList ¶
type TaskList struct { TaskListRequest Count uint64 `json:"count"` Body []TaskWithStatus `json:"body,omitempty"` }
type TaskListRequest ¶
type TaskListRequest struct { pg.OffsetLimit Status string `json:"status,omitempty"` }
type TaskMeta ¶
type TaskRelease ¶
type TaskRetain ¶
type TaskRetain struct {
Worker string `json:"worker,omitempty"`
}
type TaskWithStatus ¶
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"` }
type TickerList ¶
type TickerList struct { TickerListRequest Count uint64 `json:"count"` Body []Ticker `json:"body,omitempty"` }
func (TickerList) String ¶
func (t TickerList) String() string
type TickerListRequest ¶
type TickerListRequest struct {
pg.OffsetLimit
}
type TickerMeta ¶
type TickerMeta struct { Ticker string `json:"ticker" arg:"" help:"Ticker name"` Payload any `json:"payload,omitempty"` Interval *time.Duration `json:"interval,omitempty" help:"Interval (default 1 minute)"` }
func (TickerMeta) String ¶
func (t TickerMeta) String() string
type TickerName ¶
type TickerName string
Click to show internal directories.
Click to hide internal directories.