Documentation
¶
Index ¶
- type Client
- func (c *Client) CleanQueue(ctx context.Context, name string) (*schema.QueueCleanResponse, error)
- func (c *Client) DeleteQueue(ctx context.Context, name string) (*schema.Queue, error)
- func (c *Client) GetQueue(ctx context.Context, name string) (*schema.QueueWithStatus, error)
- func (c *Client) GetTask(ctx context.Context, id uint64) (*schema.TaskWithStatus, error)
- func (c *Client) GetTicker(ctx context.Context, name string) (*schema.Ticker, error)
- func (c *Client) ListQueues(ctx context.Context, req schema.QueueListRequest) (*schema.QueueList, error)
- func (c *Client) ListTasks(ctx context.Context, req schema.TaskListRequest) (*schema.TaskList, error)
- func (c *Client) ListTickers(ctx context.Context, req schema.TickerListRequest) (*schema.TickerList, error)
- func (c *Client) UpdateQueue(ctx context.Context, name string, meta schema.QueueMeta) (*schema.Queue, error)
- func (c *Client) UpdateTask(ctx context.Context, id uint64, req schema.TaskUpdate) (*schema.TaskWithStatus, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
Client is a pgqueue HTTP client that wraps the base HTTP client and provides typed methods for interacting with the pgqueue API.
func New ¶
New creates a new pgqueue HTTP client with the given base URL and options. The url parameter should point to the API endpoint, e.g. "http://localhost:8080/api" - each method includes its own path, such as "queue", matching how httphandler registers its routes.
func (*Client) CleanQueue ¶ added in v1.4.8
CleanQueue deletes up to 100 of a queue's done and failed tasks, which finished longer ago than the retention period, and returns them
func (*Client) DeleteQueue ¶ added in v1.4.8
DeleteQueue deletes a queue, with all its tasks, and returns it
func (*Client) GetTask ¶ added in v1.4.3
GetTask returns a task by id, with its status. The task isn't retained or changed
func (*Client) ListQueues ¶
func (c *Client) ListQueues(ctx context.Context, req schema.QueueListRequest) (*schema.QueueList, error)
ListQueues returns a page of queues, in name order, with the total number of queues
func (*Client) ListTasks ¶
func (c *Client) ListTasks(ctx context.Context, req schema.TaskListRequest) (*schema.TaskList, error)
ListTasks returns a page of tasks, by priority, highest first, which is the lowest, and then oldest first, with the total number of tasks matching the request, which can have a status
func (*Client) ListTickers ¶
func (c *Client) ListTickers(ctx context.Context, req schema.TickerListRequest) (*schema.TickerList, error)
ListTickers returns a page of tickers in name order, with the total number of tickers
func (*Client) UpdateQueue ¶ added in v1.4.8
func (c *Client) UpdateQueue(ctx context.Context, name string, meta schema.QueueMeta) (*schema.Queue, error)
UpdateQueue changes a queue's settings, keeping those which aren't set, and returns the queue
func (*Client) UpdateTask ¶ added in v1.4.8
func (c *Client) UpdateTask(ctx context.Context, id uint64, req schema.TaskUpdate) (*schema.TaskWithStatus, error)
UpdateTask changes the priority of a task which hasn't run yet, so is new, delayed, or waiting to be retried, and returns it, with its status