redis

package
v1.2.2-0...-70982f0 Latest Latest
Warning

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

Go to latest
Published: Dec 3, 2024 License: AGPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrNotFound = errors.New("not found")

Functions

func New

func New(ctx context.Context, cfg cfg.Redis) (redis.UniversalClient, error)

Types

type Model

type Model[T Modelable] struct {
	// contains filtered or unexported fields
}

Model creates a CRUD layer for the underlying type

func NewModel

func NewModel[T Modelable](v T) *Model[T]

func (*Model[T]) Delete

func (m *Model[T]) Delete(ctx context.Context, db redis.UniversalClient) error

func (*Model[T]) Load

func (m *Model[T]) Load(ctx context.Context, db redis.UniversalClient) error

func (*Model[T]) Update

func (m *Model[T]) Update(ctx context.Context, db redis.UniversalClient) error

type Modelable

type Modelable interface {
	Key() string
	Expiration() time.Duration
}

Jump to

Keyboard shortcuts

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