maestro

package
v0.7.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 16, 2023 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Overview

Package maestro is a generated GoMock package.

Index

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 NewCachedClient(maestro Maestro, cache cache.Cache, cachedQueues []string, completedTaskTTL time.Duration) *CachedClient

func (*CachedClient) CompleteTask

func (m *CachedClient) CompleteTask(taskID, result string) error

func (*CachedClient) Consume

func (m *CachedClient) Consume(queue string) (*Task, 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)

func (*CachedClient) TaskState

func (m *CachedClient) TaskState(taskID string) (*Task, error)

type Client

type Client struct {
	// contains filtered or unexported fields
}

func NewClient

func NewClient(endpoint string) *Client

func (Client) CompleteTask

func (m Client) CompleteTask(taskID, result string) error

func (Client) Consume

func (m Client) Consume(queue string) (*Task, error)

func (Client) CreateTask

func (m Client) CreateTask(owner, queue, payload string, options ...CreateTaskOptions) (string, error)

func (Client) DeleteTask

func (m Client) DeleteTask(taskID string) error

func (Client) FailTask

func (m Client) FailTask(taskID string) error

func (Client) NextInQueue

func (m Client) NextInQueue(queueName string) (*Task, error)

func (Client) QueueStats

func (m Client) QueueStats(queue string) (map[string][]string, error)

func (Client) TaskState

func (m Client) TaskState(taskID string) (*Task, error)

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.

func (*MockMaestro) TaskState

func (m *MockMaestro) TaskState(arg0 string) (*Task, error)

TaskState 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"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL