cache

package
v0.0.0-...-1ff46e3 Latest Latest
Warning

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

Go to latest
Published: Mar 4, 2021 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrNoEntry = errors.New("no entry found or job deleted")

Functions

func ClearRedisCacheAll

func ClearRedisCacheAll() error

ClearRedisCacheAll clears the entire cache.

func DeleteJobInCache

func DeleteJobInCache(job int) error

DeleteJobInCache removes the job in the redis cache

func SeedCache

func SeedCache() error

SeedCache is used for populating the Redis cache on first run

Types

type Since

type Since struct {
	Job   int    `redis:"job"`
	Title string `redis:"title"`
	Time  string `redis:"time"`
}

Since struct defines the cache data structure

func ReadCache

func ReadCache(job int) (*Since, error)

ReadCache reads from the redis cache based on job number

func WriteCache

func WriteCache(job int, title string) (*Since, error)

WriteCache writes to cache by passing in the job number/id and any title/info that we want to add

Jump to

Keyboard shortcuts

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