Documentation ¶
Index ¶
- Variables
- func GenerateIndexBaseKey(model any, field string, val any) string
- func GetBucket(key string) string
- func GzipCompress(src []byte) ([]byte, error)
- func GzipUncompress(src []byte) ([]byte, error)
- func NewModel(model any) any
- func PaddingZero(val any, length int) string
- func ParseReflectValue(val reflect.Value) (any, bool)
- func ToBytes(data any) []byte
- func ToEntities[T any](items []any) []T
- func ToEntity[T any](val any) T
- func ToModelName(model any) string
- func ToSnake(text string) string
- type DB
- type ListOption
- type Txn
- func (txn *Txn) Dec(key string, step int64) (int64, error)
- func (txn *Txn) Del(key string) error
- func (txn *Txn) Get(key string) ([]byte, error)
- func (txn *Txn) Has(key string) bool
- func (txn *Txn) Inc(key string, step int64) (int64, error)
- func (txn *Txn) IndexAdd(model any, field string, val, id any) error
- func (txn *Txn) IndexClear(model any, field string, val any) error
- func (txn *Txn) IndexCount(model any, field string, val any) (total int64)
- func (txn *Txn) IndexDel(model any, field string, val, id any) error
- func (txn *Txn) IndexFirst(model any, field string, val any) (string, error)
- func (txn *Txn) IndexList(model any, field string, val any, opts ...*ListOption) (list []string, err error)
- func (txn *Txn) IndexModel(id, model any, isCreate bool) error
- func (txn *Txn) List(prefix string, fn func(key string, value []byte) (stop bool, err error), ...) error
- func (txn *Txn) ModelCounter(model any) (count int64)
- func (txn *Txn) ModelDel(model, id any) error
- func (txn *Txn) ModelGet(model, id any) (any, error)
- func (txn *Txn) ModelIdLength(model any) (length int)
- func (txn *Txn) ModelIndexList(model any, feild string, val any, opts ...*ListOption) (list []any, err error)
- func (txn *Txn) ModelList(model any, limit int, begin string, reverse bool) (list []any, err error)
- func (txn *Txn) ModelNextID(model any, length int) string
- func (txn *Txn) ModelSet(model, id any) error
- func (txn *Txn) ModelTotal(model any) (count int64)
- func (txn *Txn) ModelUnmarshal(model, id any) error
- func (txn *Txn) ModelUpdate(model, id any, cb func(mPointer any) error) error
- func (txn *Txn) Set(key string, value any) error
- func (txn *Txn) Unmarshal(key string, value any) error
Constants ¶
This section is empty.
Variables ¶
View Source
var (
ErrKeyNotFound = errors.New("key not found")
)
Functions ¶
func GenerateIndexBaseKey ¶ added in v4.0.7
func GzipCompress ¶
func GzipUncompress ¶
func PaddingZero ¶
func ParseReflectValue ¶
Whether value can be taken directly
func ToEntities ¶ added in v4.0.11
func ToModelName ¶
Types ¶
type ListOption ¶
type Txn ¶
type Txn struct {
// contains filtered or unexported fields
}
func (*Txn) IndexFirst ¶
func (*Txn) IndexModel ¶
When isCreate is true, it means to create an index, otherwise it means to delete the index
func (*Txn) ModelCounter ¶ added in v4.0.9
func (*Txn) ModelIdLength ¶ added in v4.0.9
func (*Txn) ModelIndexList ¶ added in v4.0.9
func (*Txn) ModelTotal ¶ added in v4.0.9
func (*Txn) ModelUnmarshal ¶ added in v4.0.10
func (*Txn) ModelUpdate ¶ added in v4.0.9
Source Files ¶
Click to show internal directories.
Click to hide internal directories.