redis

package
v0.5.1 Latest Latest
Warning

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

Go to latest
Published: Apr 16, 2022 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Redis

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

Redis represents a redis client.

func New

func New(url string, poolSize, minIdleConns int, keyPrefix string) *Redis

New returns a redis client.

func (*Redis) CheckHealth

func (rs *Redis) CheckHealth() bool

CheckHealth returns the status of redis.

func (*Redis) Close

func (rs *Redis) Close() error

Close terminates any storage connections gracefully.

func (*Redis) CreateJob

func (rs *Redis) CreateJob(j *domain.Job) error

CreateJob adds a new job to the repository.

func (*Redis) CreateJobResult

func (rs *Redis) CreateJobResult(result *domain.JobResult) error

CreateJobResult adds a new job result to the repository.

func (*Redis) DeleteJob

func (rs *Redis) DeleteJob(id string) error

DeleteJob deletes a job from the repository.

func (*Redis) DeleteJobResult

func (rs *Redis) DeleteJobResult(jobID string) error

DeleteJobResult deletes a job result from the repository.

func (*Redis) GetDueJobs

func (rs *Redis) GetDueJobs() ([]*domain.Job, error)

GetDueJobs fetches all jobs scheduled to run before now and have not been scheduled yet.

func (*Redis) GetJob

func (rs *Redis) GetJob(id string) (*domain.Job, error)

GetJob fetches a job from the repository.

func (*Redis) GetJobResult

func (rs *Redis) GetJobResult(jobID string) (*domain.JobResult, error)

GetJobResult fetches a job result from the repository.

func (*Redis) GetJobs

func (rs *Redis) GetJobs(status domain.JobStatus) ([]*domain.Job, error)

GetJobs fetches all jobs from the repository, optionally filters the jobs by status.

func (*Redis) UpdateJob

func (rs *Redis) UpdateJob(id string, j *domain.Job) error

UpdateJob adds a new job to the repository.

func (*Redis) UpdateJobResult

func (rs *Redis) UpdateJobResult(jobID string, result *domain.JobResult) error

UpdateJobResult updates a job result to the repository.

Jump to

Keyboard shortcuts

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