store

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Mar 15, 2023 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrNotFound = errors.New("No data found for this key")

Functions

This section is empty.

Types

type DbInterface

type DbInterface interface {
	FindJson(result interface{}, filter []byte) error
	AddOrUpdate(key interface{}, data interface{}) error
	AddWithTTL(key, value interface{}, ttl time.Duration) error
	Get(key interface{}, result interface{}) error
	Delete(key interface{}, dataType interface{}) error
	FindWhereEq(result interface{}, filed string, value interface{}) error
	FindWhereNe(result interface{}, filed string, value interface{}) error
	FindWhereGt(result interface{}, filed string, value interface{}) error
	FindWhereLt(result interface{}, filed string, value interface{}) error
	FindWhereGe(result interface{}, filed string, value interface{}) error
	FindWhereLe(result interface{}, filed string, value interface{}) error
	FindWhereAnd2Eq(result interface{}, filed1 string, value1 interface{}, filed2 string, value2 interface{}) error
	FindWhereAnd4Eq(result interface{}, filed1 string, value1 interface{}, filed2 string, value2 interface{}, filed3 string, value3 interface{}, filed4 string, value4 interface{}) error
}

type Repository

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

func New

func New(r DbInterface) *Repository

func OpenDb

func OpenDb(database, table string) (*Repository, error)

func (*Repository) AddOrUpdate

func (r *Repository) AddOrUpdate(key interface{}, data interface{}) error

func (*Repository) AddWithTTL

func (r *Repository) AddWithTTL(key, value interface{}, ttl time.Duration) error

func (*Repository) Delete

func (r *Repository) Delete(key interface{}, dataType interface{}) error

func (*Repository) FindJson

func (r *Repository) FindJson(result interface{}, filter []byte) error

func (*Repository) FindWhereAnd2Eq

func (r *Repository) FindWhereAnd2Eq(result interface{}, filed1 string, value1 interface{}, filed2 string, value2 interface{}) error

func (*Repository) FindWhereAnd4Eq

func (r *Repository) FindWhereAnd4Eq(result interface{}, filed1 string, value1 interface{}, filed2 string, value2 interface{}, filed3 string, value3 interface{}, filed4 string, value4 interface{}) error

func (*Repository) FindWhereEq

func (r *Repository) FindWhereEq(result interface{}, filed string, value interface{}) error

func (*Repository) FindWhereGe

func (r *Repository) FindWhereGe(result interface{}, filed string, value interface{}) error

func (*Repository) FindWhereGt

func (r *Repository) FindWhereGt(result interface{}, filed string, value interface{}) error

func (*Repository) FindWhereLe

func (r *Repository) FindWhereLe(result interface{}, filed string, value interface{}) error

func (*Repository) FindWhereLt

func (r *Repository) FindWhereLt(result interface{}, filed string, value interface{}) error

func (*Repository) FindWhereNe

func (r *Repository) FindWhereNe(result interface{}, filed string, value interface{}) error

func (*Repository) Get

func (r *Repository) Get(key interface{}, result interface{}) error

Directories

Path Synopsis
repo

Jump to

Keyboard shortcuts

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