{"modulePath":"github.com/mutablelogic/go-pg","version":"v1.5.1","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package cmd\n\n## Functions\n\n```go\nfunc WithClient(ctx server.Cmd, span string, fn func(context.Context, *httpclient.Client) error) (err error)\n```\nWithClient creates a pgqueue HTTP client from the command context and calls fn with it\n\n## Types\n\n```go\ntype ClientCommands struct {\n\tQueueCommands\n\tTickerCommands\n\tTaskCommands\n}\n```\n\n```go\ntype Flags struct {\n}\n```\n\n```go\nfunc (flags Flags) WithManager(ctx server.Cmd, conn pg.PoolConn, srv *servercmd.RunServer, fn func(*pgqueue.Manager) error, opts ...pgqueue.Opt) error\n```\nWithManager creates a task queue manager, with the server's tracer and meter, and then the options, such as the database schema, registers its HTTP handlers with the server, when there is one, and then calls the function with it, returning any error\n\n```go\ntype QueueCleanCmd struct {\n\tName string `arg:\"\" help:\"Queue name\"`\n}\n```\n\n```go\nfunc (cmd *QueueCleanCmd) Run(ctx server.Cmd) error\n```\n\n```go\ntype QueueCommands struct {\n\tQueueList   QueueListCmd   `cmd:\"\" name:\"queues\" help:\"List the queues.\" group:\"TASK QUEUES\"`\n\tQueueGet    QueueGetCmd    `cmd:\"\" name:\"queue\" help:\"Get a queue.\" group:\"TASK QUEUES\"`\n\tQueueUpdate QueueUpdateCmd `cmd:\"\" name:\"queue-update\" help:\"Change a queue's settings.\" group:\"TASK QUEUES\"`\n\tQueueDelete QueueDeleteCmd `cmd:\"\" name:\"queue-delete\" help:\"Delete a queue, with all its tasks.\" group:\"TASK QUEUES\"`\n\tQueueClean  QueueCleanCmd  `cmd:\"\" name:\"queue-clean\" help:\"Delete a queue's done and failed tasks, after the retention period.\" group:\"TASK QUEUES\"`\n}\n```\n\n```go\ntype QueueDeleteCmd struct {\n\tName string `arg:\"\" help:\"Queue name\"`\n}\n```\n\n```go\nfunc (cmd *QueueDeleteCmd) Run(ctx server.Cmd) error\n```\n\n```go\ntype QueueGetCmd struct {\n\tName string `arg:\"\" help:\"Queue name\"`\n}\n```\n\n```go\nfunc (cmd *QueueGetCmd) Run(ctx server.Cmd) error\n```\n\n```go\ntype QueueListCmd struct {\n\tschema.QueueListRequest\n}\n```\n\n```go\nfunc (cmd *QueueListCmd) Run(ctx server.Cmd) error\n```\n\n```go\ntype QueueUpdateCmd struct {\n\tName             string `arg:\"\" help:\"Queue name\"`\n\tschema.QueueMeta `embed:\"\"`\n}\n```\n\n```go\nfunc (cmd *QueueUpdateCmd) Run(ctx server.Cmd) error\n```\n\n```go\ntype TaskCommands struct {\n\tTaskList     TaskListCmd     `cmd:\"\" name:\"tasks\" help:\"List the tasks, optionally in some queues, or with some statuses.\" group:\"TASK QUEUES\"`\n\tTaskGet      TaskGetCmd      `cmd:\"\" name:\"task\" help:\"Get a task, with its status, without retaining it.\" group:\"TASK QUEUES\"`\n\tTaskPriority TaskPriorityCmd `cmd:\"\" name:\"task-priority\" help:\"Change the priority of a task which hasn't run yet.\" group:\"TASK QUEUES\"`\n}\n```\n\n```go\ntype TaskGetCmd struct {\n\tId uint64 `arg:\"\" help:\"Task id\"`\n}\n```\n\n```go\nfunc (cmd *TaskGetCmd) Run(ctx server.Cmd) error\n```\n\n```go\ntype TaskListCmd struct {\n\tpg.OffsetLimit `embed:\"\"`\n\tQueue          []string `name:\"queue\" help:\"Only list the tasks in these queues.\" optional:\"\"`\n\tStatus         []string `name:\"status\" help:\"Only list the tasks with these statuses: new, delayed, running, retry, failed or done.\" optional:\"\"`\n}\n```\n\n```go\nfunc (cmd *TaskListCmd) Run(ctx server.Cmd) error\n```\n\n```go\ntype TaskPriorityCmd struct {\n\tId       uint64 `arg:\"\" help:\"Task id\"`\n\tPriority uint16 `arg:\"\" help:\"Priority, where 0 is the highest, and lower runs first\"`\n}\n```\n\n```go\nfunc (cmd *TaskPriorityCmd) Run(ctx server.Cmd) error\n```\n\n```go\ntype TickerCommands struct {\n\tTickerList TickerListCmd `cmd:\"\" name:\"tickers\" help:\"List the tickers.\" group:\"TASK QUEUES\"`\n\tTickerGet  TickerGetCmd  `cmd:\"\" name:\"ticker\" help:\"Get a ticker.\" group:\"TASK QUEUES\"`\n}\n```\n\n```go\ntype TickerGetCmd struct {\n\tName string `arg:\"\" help:\"Ticker name\"`\n}\n```\n\n```go\nfunc (cmd *TickerGetCmd) Run(ctx server.Cmd) error\n```\n\n```go\ntype TickerListCmd struct {\n\tschema.TickerListRequest\n}\n```\n\n```go\nfunc (cmd *TickerListCmd) Run(ctx server.Cmd) error\n```\n\n","path":"github.com/mutablelogic/go-pg/pgqueue/cmd","name":"cmd","synopsis":"","isRedistributable":true}
