Documentation ¶
Overview ¶
Package maestro is a generated GoMock package.
Index ¶
- type CachedClient
- func (m *CachedClient) CompleteTask(taskID, result string) error
- func (m *CachedClient) Consume(queue string) (*Task, error)
- func (m *CachedClient) CreateTask(owner, queue, payload string, options ...CreateTaskOptions) (string, error)
- func (m *CachedClient) DeleteTask(taskID string) error
- func (m *CachedClient) FailTask(taskID string) error
- func (m *CachedClient) NextInQueue(queueName string) (*Task, error)
- func (m *CachedClient) QueueStats(queue string) (map[string][]string, error)
- func (m *CachedClient) TaskState(taskID string) (*Task, error)
- type Client
- func (m Client) CompleteTask(taskID, result string) error
- func (m Client) Consume(queue string) (*Task, error)
- func (m Client) CreateTask(owner, queue, payload string, options ...CreateTaskOptions) (string, error)
- func (m Client) DeleteTask(taskID string) error
- func (m Client) FailTask(taskID string) error
- func (m Client) NextInQueue(queueName string) (*Task, error)
- func (m Client) QueueStats(queue string) (map[string][]string, error)
- func (m Client) TaskState(taskID string) (*Task, error)
- type CreateTaskOptions
- func (c *CreateTaskOptions) ExecutesIn() time.Duration
- func (c *CreateTaskOptions) Retries() int
- func (c *CreateTaskOptions) StartTimeout() time.Duration
- func (c *CreateTaskOptions) Timeout() time.Duration
- func (c *CreateTaskOptions) WithExecutesIn(executesIn time.Duration) *CreateTaskOptions
- func (c *CreateTaskOptions) WithRetries(retries int) *CreateTaskOptions
- func (c *CreateTaskOptions) WithStartTimeout(startTimeout time.Duration) *CreateTaskOptions
- func (c *CreateTaskOptions) WithTimeout(timeout time.Duration) *CreateTaskOptions
- type Maestro
- type MockMaestro
- func (m *MockMaestro) CompleteTask(arg0, arg1 string) error
- func (m *MockMaestro) Consume(arg0 string) (*Task, error)
- func (m *MockMaestro) CreateTask(arg0, arg1, arg2 string, arg3 ...CreateTaskOptions) (string, error)
- func (m *MockMaestro) DeleteTask(arg0 string) error
- func (m *MockMaestro) EXPECT() *MockMaestroMockRecorder
- func (m *MockMaestro) FailTask(arg0 string) error
- func (m *MockMaestro) NextInQueue(arg0 string) (*Task, error)
- func (m *MockMaestro) QueueStats(arg0 string) (map[string][]string, error)
- func (m *MockMaestro) TaskState(arg0 string) (*Task, error)
- type MockMaestroMockRecorder
- func (mr *MockMaestroMockRecorder) CompleteTask(arg0, arg1 interface{}) *gomock.Call
- func (mr *MockMaestroMockRecorder) Consume(arg0 interface{}) *gomock.Call
- func (mr *MockMaestroMockRecorder) CreateTask(arg0, arg1, arg2 interface{}, arg3 ...interface{}) *gomock.Call
- func (mr *MockMaestroMockRecorder) DeleteTask(arg0 interface{}) *gomock.Call
- func (mr *MockMaestroMockRecorder) FailTask(arg0 interface{}) *gomock.Call
- func (mr *MockMaestroMockRecorder) NextInQueue(arg0 interface{}) *gomock.Call
- func (mr *MockMaestroMockRecorder) QueueStats(arg0 interface{}) *gomock.Call
- func (mr *MockMaestroMockRecorder) TaskState(arg0 interface{}) *gomock.Call
- type Task
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CachedClient ¶
type CachedClient struct {
// contains filtered or unexported fields
}
func NewCachedClient ¶
func (*CachedClient) CompleteTask ¶
func (m *CachedClient) CompleteTask(taskID, result string) error
func (*CachedClient) CreateTask ¶
func (m *CachedClient) CreateTask(owner, queue, payload string, options ...CreateTaskOptions) (string, error)
func (*CachedClient) DeleteTask ¶
func (m *CachedClient) DeleteTask(taskID string) error
func (*CachedClient) FailTask ¶
func (m *CachedClient) FailTask(taskID string) error
func (*CachedClient) NextInQueue ¶
func (m *CachedClient) NextInQueue(queueName string) (*Task, error)
func (*CachedClient) QueueStats ¶
func (m *CachedClient) QueueStats(queue string) (map[string][]string, error)
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func (Client) CompleteTask ¶
func (Client) CreateTask ¶
func (m Client) CreateTask(owner, queue, payload string, options ...CreateTaskOptions) (string, error)
func (Client) DeleteTask ¶
type CreateTaskOptions ¶
type CreateTaskOptions struct {
// contains filtered or unexported fields
}
func MergeCreateTaskOptions ¶
func MergeCreateTaskOptions(options ...CreateTaskOptions) *CreateTaskOptions
Merge always merge the last given option or return the default option if none. There is no partial merge.
func NewCreateTaskOptions ¶
func NewCreateTaskOptions() *CreateTaskOptions
func (*CreateTaskOptions) ExecutesIn ¶
func (c *CreateTaskOptions) ExecutesIn() time.Duration
func (*CreateTaskOptions) Retries ¶
func (c *CreateTaskOptions) Retries() int
func (*CreateTaskOptions) StartTimeout ¶
func (c *CreateTaskOptions) StartTimeout() time.Duration
func (*CreateTaskOptions) Timeout ¶
func (c *CreateTaskOptions) Timeout() time.Duration
func (*CreateTaskOptions) WithExecutesIn ¶
func (c *CreateTaskOptions) WithExecutesIn(executesIn time.Duration) *CreateTaskOptions
func (*CreateTaskOptions) WithRetries ¶
func (c *CreateTaskOptions) WithRetries(retries int) *CreateTaskOptions
func (*CreateTaskOptions) WithStartTimeout ¶
func (c *CreateTaskOptions) WithStartTimeout(startTimeout time.Duration) *CreateTaskOptions
func (*CreateTaskOptions) WithTimeout ¶
func (c *CreateTaskOptions) WithTimeout(timeout time.Duration) *CreateTaskOptions
type Maestro ¶
type Maestro interface { CreateTask(owner, queue, payload string, options ...CreateTaskOptions) (string, error) TaskState(taskID string) (*Task, error) DeleteTask(taskID string) error FailTask(taskID string) error NextInQueue(queueName string) (*Task, error) CompleteTask(taskID, result string) error Consume(queue string) (*Task, error) QueueStats(queue string) (map[string][]string, error) }
type MockMaestro ¶
type MockMaestro struct {
// contains filtered or unexported fields
}
MockMaestro is a mock of Maestro interface.
func NewMockMaestro ¶
func NewMockMaestro(ctrl *gomock.Controller) *MockMaestro
NewMockMaestro creates a new mock instance.
func (*MockMaestro) CompleteTask ¶
func (m *MockMaestro) CompleteTask(arg0, arg1 string) error
CompleteTask mocks base method.
func (*MockMaestro) Consume ¶
func (m *MockMaestro) Consume(arg0 string) (*Task, error)
Consume mocks base method.
func (*MockMaestro) CreateTask ¶
func (m *MockMaestro) CreateTask(arg0, arg1, arg2 string, arg3 ...CreateTaskOptions) (string, error)
CreateTask mocks base method.
func (*MockMaestro) DeleteTask ¶
func (m *MockMaestro) DeleteTask(arg0 string) error
DeleteTask mocks base method.
func (*MockMaestro) EXPECT ¶
func (m *MockMaestro) EXPECT() *MockMaestroMockRecorder
EXPECT returns an object that allows the caller to indicate expected use.
func (*MockMaestro) FailTask ¶
func (m *MockMaestro) FailTask(arg0 string) error
FailTask mocks base method.
func (*MockMaestro) NextInQueue ¶
func (m *MockMaestro) NextInQueue(arg0 string) (*Task, error)
NextInQueue mocks base method.
func (*MockMaestro) QueueStats ¶
func (m *MockMaestro) QueueStats(arg0 string) (map[string][]string, error)
QueueStats mocks base method.
type MockMaestroMockRecorder ¶
type MockMaestroMockRecorder struct {
// contains filtered or unexported fields
}
MockMaestroMockRecorder is the mock recorder for MockMaestro.
func (*MockMaestroMockRecorder) CompleteTask ¶
func (mr *MockMaestroMockRecorder) CompleteTask(arg0, arg1 interface{}) *gomock.Call
CompleteTask indicates an expected call of CompleteTask.
func (*MockMaestroMockRecorder) Consume ¶
func (mr *MockMaestroMockRecorder) Consume(arg0 interface{}) *gomock.Call
Consume indicates an expected call of Consume.
func (*MockMaestroMockRecorder) CreateTask ¶
func (mr *MockMaestroMockRecorder) CreateTask(arg0, arg1, arg2 interface{}, arg3 ...interface{}) *gomock.Call
CreateTask indicates an expected call of CreateTask.
func (*MockMaestroMockRecorder) DeleteTask ¶
func (mr *MockMaestroMockRecorder) DeleteTask(arg0 interface{}) *gomock.Call
DeleteTask indicates an expected call of DeleteTask.
func (*MockMaestroMockRecorder) FailTask ¶
func (mr *MockMaestroMockRecorder) FailTask(arg0 interface{}) *gomock.Call
FailTask indicates an expected call of FailTask.
func (*MockMaestroMockRecorder) NextInQueue ¶
func (mr *MockMaestroMockRecorder) NextInQueue(arg0 interface{}) *gomock.Call
NextInQueue indicates an expected call of NextInQueue.
func (*MockMaestroMockRecorder) QueueStats ¶
func (mr *MockMaestroMockRecorder) QueueStats(arg0 interface{}) *gomock.Call
QueueStats indicates an expected call of QueueStats.
func (*MockMaestroMockRecorder) TaskState ¶
func (mr *MockMaestroMockRecorder) TaskState(arg0 interface{}) *gomock.Call
TaskState indicates an expected call of TaskState.
type Task ¶
type Task struct { TaskID string `json:"task_id"` Owner string `json:"owner"` TaskQueue string `json:"task_queue"` Payload string `json:"payload"` State string `json:"state"` Timeout int32 `json:"timeout"` Retries int32 `json:"retries"` MaxRetries int32 `json:"max_retries"` CreatedAt int64 `json:"created_at"` UpdatedAt int64 `json:"updated_at"` Result string `json:"result,omitempty"` }