store

package
v0.0.0-...-5552a58 Latest Latest
Warning

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

Go to latest
Published: Mar 20, 2024 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	NotFoundError      = errors.New("object not found")
	AlreadyExistsError = errors.New("object already exists")
)

Functions

This section is empty.

Types

type Memory

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

func NewMemory

func NewMemory() *Memory

func (*Memory) Add

func (m *Memory) Add(_ context.Context, key, value string) error

func (*Memory) Clear

func (m *Memory) Clear(_ context.Context) error

func (*Memory) Delete

func (m *Memory) Delete(_ context.Context, key string) error

func (*Memory) Get

func (m *Memory) Get(_ context.Context, key string) (string, error)

func (*Memory) GetStoreType

func (m *Memory) GetStoreType(ctx context.Context) string

func (*Memory) Keys

func (m *Memory) Keys(_ context.Context, pattern string) ([]string, error)

type Redis

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

func NewRedis

func NewRedis(client *redis.Client) *Redis

func (*Redis) Add

func (m *Redis) Add(ctx context.Context, key, value string) error

func (*Redis) Clear

func (m *Redis) Clear(ctx context.Context) error

func (*Redis) Delete

func (m *Redis) Delete(ctx context.Context, key string) error

func (*Redis) Get

func (m *Redis) Get(ctx context.Context, key string) (string, error)

func (*Redis) GetStoreType

func (m *Redis) GetStoreType(ctx context.Context) string

func (*Redis) Keys

func (m *Redis) Keys(ctx context.Context, pattern string) ([]string, error)

type Store

type Store interface {
	Add(ctx context.Context, key, value string) error
	Get(ctx context.Context, key string) (string, error)
	Keys(ctx context.Context, pattern string) ([]string, error)
	Delete(ctx context.Context, key string) error
	Clear(ctx context.Context) error
	GetStoreType(ctx context.Context) string
}

Jump to

Keyboard shortcuts

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