Documentation ¶
Overview ¶
Package stub provides a stub engine that returns canned data for testing.
Index ¶
- type Engine
- func (g *Engine) Chore(ctx context.Context) error
- func (g *Engine) Close(ctx context.Context) error
- func (g *Engine) Commit(ctx context.Context, id string, m *ratus.Commit) (*ratus.Task, error)
- func (g *Engine) DeletePromise(ctx context.Context, id string) (*ratus.Deleted, error)
- func (g *Engine) DeletePromises(ctx context.Context, topic string) (*ratus.Deleted, error)
- func (g *Engine) DeleteTask(ctx context.Context, id string) (*ratus.Deleted, error)
- func (g *Engine) DeleteTasks(ctx context.Context, topic string) (*ratus.Deleted, error)
- func (g *Engine) DeleteTopic(ctx context.Context, topic string) (*ratus.Deleted, error)
- func (g *Engine) DeleteTopics(ctx context.Context) (*ratus.Deleted, error)
- func (g *Engine) Destroy(ctx context.Context) error
- func (g *Engine) GetPromise(ctx context.Context, id string) (*ratus.Promise, error)
- func (g *Engine) GetTask(ctx context.Context, id string) (*ratus.Task, error)
- func (g *Engine) GetTopic(ctx context.Context, topic string) (*ratus.Topic, error)
- func (g *Engine) InsertPromise(ctx context.Context, p *ratus.Promise) (*ratus.Task, error)
- func (g *Engine) InsertTask(ctx context.Context, t *ratus.Task) (*ratus.Updated, error)
- func (g *Engine) InsertTasks(ctx context.Context, ts []*ratus.Task) (*ratus.Updated, error)
- func (g *Engine) ListPromises(ctx context.Context, topic string, limit, offset int) ([]*ratus.Promise, error)
- func (g *Engine) ListTasks(ctx context.Context, topic string, limit, offset int) ([]*ratus.Task, error)
- func (g *Engine) ListTopics(ctx context.Context, limit, offset int) ([]*ratus.Topic, error)
- func (g *Engine) Open(ctx context.Context) error
- func (g *Engine) Poll(ctx context.Context, topic string, p *ratus.Promise) (*ratus.Task, error)
- func (g *Engine) Ready(ctx context.Context) error
- func (g *Engine) UpsertPromise(ctx context.Context, p *ratus.Promise) (*ratus.Task, error)
- func (g *Engine) UpsertTask(ctx context.Context, t *ratus.Task) (*ratus.Updated, error)
- func (g *Engine) UpsertTasks(ctx context.Context, ts []*ratus.Task) (*ratus.Updated, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Engine ¶
type Engine struct {
Err error
}
Engine is a stub engine that returns canned data for testing.
func (*Engine) DeletePromise ¶
DeletePromise deletes a promise by the unique ID of its target task.
func (*Engine) DeletePromises ¶
DeletePromises deletes all promises in a topic.
func (*Engine) DeleteTask ¶
DeleteTask deletes a task by its unique ID.
func (*Engine) DeleteTasks ¶
DeleteTasks deletes all tasks in a topic.
func (*Engine) DeleteTopic ¶
DeleteTopic deletes a topic and its tasks.
func (*Engine) DeleteTopics ¶
DeleteTopics deletes all topics and tasks.
func (*Engine) GetPromise ¶
GetPromise gets a promise by the unique ID of its target task.
func (*Engine) InsertPromise ¶
InsertPromise makes a promise to claim and execute a task if it is in pending state.
func (*Engine) InsertTask ¶
InsertTask inserts a new task.
func (*Engine) InsertTasks ¶
InsertTasks inserts a batch of tasks while ignoring existing ones.
func (*Engine) ListPromises ¶
func (g *Engine) ListPromises(ctx context.Context, topic string, limit, offset int) ([]*ratus.Promise, error)
ListPromises lists all promises in a topic.
func (*Engine) ListTasks ¶
func (g *Engine) ListTasks(ctx context.Context, topic string, limit, offset int) ([]*ratus.Task, error)
ListTasks lists all tasks in a topic.
func (*Engine) ListTopics ¶
ListTopics lists all topics.
func (*Engine) UpsertPromise ¶
UpsertPromise makes a promise to claim and execute a task regardless of its current state.
func (*Engine) UpsertTask ¶
UpsertTask inserts or updates a task.