base_redis

package
v0.2.2 Latest Latest
Warning

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

Go to latest
Published: Dec 2, 2023 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	TaskTTL    = 3600 * 6 // 6 hours
	BucketSize = time.Minute * 5
)

Functions

This section is empty.

Types

type Redis

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

func New

func New(dsn string) (*Redis, error)

func (*Redis) Close

func (r *Redis) Close() error

func (*Redis) CountTenantPendingTasks

func (r *Redis) CountTenantPendingTasks(ctx context.Context, opt types.CountTenantPendingTasksOption) (int64, error)

func (*Redis) CreateTask

func (r *Redis) CreateTask(ctx context.Context, t entity.Task) error

func (*Redis) FindPendingTasks

func (r *Redis) FindPendingTasks(ctx context.Context, opt types.FindPendingTasksOption) (entity.Tasks, error)

func (*Redis) GetTask

func (r *Redis) GetTask(ctx context.Context, opt types.GetTaskOption) (*entity.Task, error)

func (*Redis) GetTaskStatus

func (r *Redis) GetTaskStatus(ctx context.Context, opt types.GetTaskStatusOption) (enum.TaskStatus, error)

func (*Redis) LoadScripts

func (r *Redis) LoadScripts() error

func (*Redis) UpdateTaskStatus

func (r *Redis) UpdateTaskStatus(ctx context.Context, opt types.UpdateTaskStatusOption) error

Jump to

Keyboard shortcuts

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