cache

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Mar 25, 2026 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrEmployeeNotCached            = data.NewNotCachedError("employee not cached")
	ErrEmployeeNotFoundCached       = data.NewNotCachedError("employee not found; cached")
	ErrEmployeeReadSet              = data.NewNotCachedRetryError("employee not cached, read set")
	ErrEmployeeReadAlreadySet       = data.NewNotCachedRetryError("employee not cached, read already set")
	ErrEmployeeSearchNotCached      = data.NewNotCachedError("employee search not cached")
	ErrEmployeeSearchNotFoundCached = data.NewNotCachedError("employee search not found; cached")
	ErrEmployeesSearchSet           = data.NewNotCachedRetryError("employees search not cached, read set")
	ErrEmployeesSearchAlreadySet    = data.NewNotCachedRetryError("employees search not cached, read already set")
	ErrSleepNotCached               = data.NewNotCachedError("sleep not cached")
	ErrSleepNotFoundCached          = data.NewNotCachedError("sleep not found; cached")
	ErrSleepReadSet                 = data.NewNotCachedRetryError("sleep not cached, read set")
	ErrSleepReadAlreadySet          = data.NewNotCachedRetryError("sleep not cached, read already set")
)

Functions

func ErrSearchKey added in v1.1.0

func ErrSearchKey(err error) error

func NewMemory

func NewMemory(parameters ...any) interface {
	internal.Configurer
	internal.Opener
	internal.Clearer
	Cache
}

func NewRedis

func NewRedis(parameters ...any) interface {
	internal.Configurer
	internal.Opener
	internal.Clearer
	Cache
}

func NewStash added in v1.1.0

func NewStash(parameters ...any) interface {
	internal.Configurer
	internal.Opener
	internal.Clearer
	Cache
}

Types

type Cache

type Cache interface {
	EmployeeRead(ctx context.Context, empNo int64) (*data.Employee, error)
	EmployeesRead(ctx context.Context, search data.EmployeeSearch) ([]*data.Employee, error)
	EmployeesWrite(ctx context.Context, search data.EmployeeSearch, employees ...*data.Employee) error
	EmployeesDelete(ctx context.Context, empNos ...int64) error
	EmployeesNotFoundWrite(ctx context.Context, search data.EmployeeSearch, empNos ...int64) error

	SleepRead(ctx context.Context, sleepId string) (*data.Sleep, error)
	SleepWrite(ctx context.Context, sleep *data.Sleep) error
	SleepsDelete(ctx context.Context, sleepIds ...string) error
}

Jump to

Keyboard shortcuts

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