Documentation ¶
Overview ¶
Package client contains the base job-manager http client.
Index ¶
- Variables
- func IsNotFound(err error) bool
- func SetMockTime(ctx context.Context, t time.Time) context.Context
- type APIError
- type AckJobOpts
- type Client
- func (c *Client) AckJob(ctx context.Context, id string, status resource.Status) error
- func (c *Client) AckJobOpts(ctx context.Context, id string, status resource.Status, opts AckJobOpts) error
- func (c *Client) BlockQueue(ctx context.Context, queue string) error
- func (c *Client) DeleteQueue(ctx context.Context, queue string) error
- func (c *Client) DequeueJobs(ctx context.Context, num int, queueID string) (*resource.Jobs, error)
- func (c *Client) DequeueJobsOpts(ctx context.Context, num int, opts DequeueOpts) (*resource.Jobs, error)
- func (c *Client) EnqueueJob(ctx context.Context, name string, args ...interface{}) (string, error)
- func (c *Client) EnqueueJobOpts(ctx context.Context, name string, opts EnqueueOpts, args ...interface{}) (string, error)
- func (c *Client) GetJob(ctx context.Context, id string, opts *GetJobOpts) (*resource.Job, error)
- func (c *Client) GetQueue(ctx context.Context, id string) (*resource.Queue, error)
- func (c *Client) ListJobs(ctx context.Context, opts ListJobsOpts) (*resource.Jobs, error)
- func (c *Client) ListQueues(ctx context.Context, opts ListQueuesOpts) (*resource.Queues, error)
- func (c *Client) PauseQueue(ctx context.Context, queue string) error
- func (c *Client) Ping(ctx context.Context) error
- func (c *Client) SaveQueue(ctx context.Context, name string, opts SaveQueueOpts) (*resource.Queue, error)
- func (c *Client) Stats(ctx context.Context, queue string) (*resource.Stats, error)
- func (c *Client) UnblockQueue(ctx context.Context, queue string) error
- func (c *Client) UnpauseQueue(ctx context.Context, queue string) error
- type Config
- type DequeueOpts
- type EnqueueOpts
- type GetJobOpts
- type Interface
- type ListJobsOpts
- type ListQueuesOpts
- type Provider
- type Queue
- type SaveQueueOpts
Constants ¶
This section is empty.
Variables ¶
View Source
var ConfigDefaults = Config{
Host: ":1874",
}
Functions ¶
func IsNotFound ¶
Types ¶
type APIError ¶
type APIError struct {
*apiv1.GenericError
}
type AckJobOpts ¶
type AckJobOpts struct {
Data interface{}
}
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func (*Client) AckJobOpts ¶
func (*Client) BlockQueue ¶ added in v0.4.0
func (*Client) DeleteQueue ¶ added in v0.4.0
func (*Client) DequeueJobs ¶
func (*Client) DequeueJobsOpts ¶
func (*Client) EnqueueJob ¶
func (*Client) EnqueueJobOpts ¶
func (*Client) ListQueues ¶
func (*Client) PauseQueue ¶ added in v0.4.0
func (*Client) UnblockQueue ¶ added in v0.4.0
type Config ¶
type Config struct {
Host string `envconfig:"host" json:"host"`
}
Config holds configuration data for the job client.
type DequeueOpts ¶
type EnqueueOpts ¶
type GetJobOpts ¶
type GetJobOpts struct {
Includes []string
}
type Interface ¶
type Interface interface { // Resource(name string) resource.Interface Ping(ctx context.Context) error // consumer rpcs // EnqueueJobs(ctx context.Context, jobs *resource.Jobs) ([]string, error) // EnqueueJobsOpts(ctx context.Context, jobs *resource.Jobs, opts EnqueueOpts) ([]string, error) EnqueueJob(ctx context.Context, job string, args ...interface{}) (string, error) EnqueueJobOpts(ctx context.Context, job string, opts EnqueueOpts, args ...interface{}) (string, error) DequeueJobs(ctx context.Context, num int, id string) (*resource.Jobs, error) DequeueJobsOpts(ctx context.Context, num int, opts DequeueOpts) (*resource.Jobs, error) AckJob(ctx context.Context, id string, status resource.Status) error AckJobOpts(ctx context.Context, id string, status resource.Status, opts AckJobOpts) error ListJobs(ctx context.Context, opts ListJobsOpts) (*resource.Jobs, error) GetJob(ctx context.Context, id string, opts *GetJobOpts) (*resource.Job, error) SaveQueue(ctx context.Context, name string, opts SaveQueueOpts) (*resource.Queue, error) // SaveQueues(ctx context.Context, queue *resource.Queues) error ListQueues(ctx context.Context, opts ListQueuesOpts) (*resource.Queues, error) GetQueue(ctx context.Context, id string) (*resource.Queue, error) DeleteQueue(ctx context.Context, queue string) error PauseQueue(ctx context.Context, queue string) error UnpauseQueue(ctx context.Context, queue string) error BlockQueue(ctx context.Context, queue string) error UnblockQueue(ctx context.Context, queue string) error }
type ListJobsOpts ¶
type ListQueuesOpts ¶
type ListQueuesOpts struct { Names []string Selectors []string Page *resource.Pagination Includes []string }
Click to show internal directories.
Click to hide internal directories.