db

package
v0.0.0-...-380c7e2 Latest Latest
Warning

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

Go to latest
Published: Oct 22, 2024 License: Unlicense Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	NotFoundError = errors.New("key not found")
	InternalError = errors.New("internal error")
)

Functions

This section is empty.

Types

type Db

type Db interface {
	Get(ctx context.Context, key string) (string, error)
	Set(ctx context.Context, key string, value string) error
	Close(ctx context.Context) error
}

type RedisDb

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

func NewRedis

func NewRedis(c config.Redis) (*RedisDb, error)

func (*RedisDb) Close

func (rdb *RedisDb) Close(_ context.Context) error

func (*RedisDb) Get

func (rdb *RedisDb) Get(ctx context.Context, key string) (string, error)

func (*RedisDb) Set

func (rdb *RedisDb) Set(ctx context.Context, key string, value string) error

Jump to

Keyboard shortcuts

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