redis

package
v0.0.0-...-794f3e4 Latest Latest
Warning

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

Go to latest
Published: Sep 18, 2023 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Store

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

Store cache service

func NewRedisStore

func NewRedisStore(
	config *domain.Config,
) (*Store, error)

NewRedisStore constructor for Redis store.

func (*Store) ClearTable

func (r *Store) ClearTable(
	baseTableName string,
	baseTableSuffix string,
	tenant string,
	namespace string,
) (err error)

ClearTable removes all entries in table

func (*Store) Create

func (r *Store) Create(
	baseTableName string,
	baseTableSuffix string,
	tenant string,
	namespace string,
	id string,
	value []byte,
	expiration time.Duration) (err error)

Create updates item in Redis table -- no difference between Create and Update.

func (*Store) CreateTable

func (r *Store) CreateTable(
	_ string,
	_ string,
) (err error)

CreateTable no-op function.

func (*Store) Delete

func (r *Store) Delete(
	baseTableName string,
	baseTableSuffix string,
	tenant string,
	namespace string,
	id string) (err error)

Delete removes cache entry

func (*Store) Get

func (r *Store) Get(
	baseTableName string,
	baseTableSuffix string,
	tenant string,
	namespace string,
	ids ...string,
) (res map[string][]byte, err error)

Get finds record by ids.

func (*Store) Query

func (r *Store) Query(
	baseTableName string,
	baseTableSuffix string,
	tenant string,
	namespace string,
	predicate map[string]string,
	offsetStr string,
	limit int64,
) (res map[string][]byte, nextOffset string, err error)

Query queries records for given predicates.

func (*Store) Size

func (r *Store) Size(
	baseTableName string,
	baseTableSuffix string,
	tenant string,
	namespace string,
) (size int64, err error)

Size returns number of rows for tenant in table.

func (*Store) Update

func (r *Store) Update(
	baseTableName string,
	baseTableSuffix string,
	tenant string,
	namespace string,
	id string,
	_ int64,
	value []byte,
	expiration time.Duration) (err error)

Update updates item in Redis table.

Jump to

Keyboard shortcuts

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