scache

package
v0.0.0-...-4155a33 Latest Latest
Warning

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

Go to latest
Published: May 26, 2020 License: MIT Imports: 6 Imported by: 7

Documentation

Index

Constants

View Source
const FLAG_UPDATE_ASPECT_AFTER = 0x2000
View Source
const FLAG_UPDATE_ASPECT_BEFORE = 0x1000
View Source
const FLAG_UPDATE_DELETE = 0x2
View Source
const FLAG_UPDATE_SET = 0x1

Variables

This section is empty.

Functions

This section is empty.

Types

type Initer

type Initer func(cache *SCache, lock bool) (interface{}, error)

type Loader

type Loader func(cache *SCache, factor int, timeout time.Duration, lock bool, keys ...interface{}) (interface{}, error)

type Manager

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

func GetManager

func GetManager() *Manager

func (*Manager) Get

func (o *Manager) Get(name string) *SCache

func (*Manager) GetEx

func (o *Manager) GetEx(name string, lock bool) *SCache

func (*Manager) RGet

func (o *Manager) RGet(arg qrpc.QArg, reply *qrpc.QArg)

type SCache

type SCache struct {
	Name  string
	Db    string
	Dao   string
	Group string
	Twin  *SCache

	ArrayLimitInit   int
	Loader           Loader
	Initer           Initer
	Updater          Updater
	UseParentUpdater bool
	Timeout          time.Duration
	// contains filtered or unexported fields
}

func NewSCache

func NewSCache(name string, root *SCache, parent *SCache, lock bool, path ...interface{}) *SCache

func (*SCache) Delete

func (o *SCache) Delete(key interface{}, lock bool) error

func (*SCache) Exist

func (o *SCache) Exist(key string) (val interface{}, exist bool)

func (*SCache) Get

func (o *SCache) Get(load bool, key interface{}) (val interface{}, err error)

func (*SCache) GetAll

func (o *SCache) GetAll() (retm map[string]interface{}, err error)

func (*SCache) GetEx

func (o *SCache) GetEx(load bool, factor int, timeout time.Duration, lock bool, key interface{}) (val interface{}, err error)

func (*SCache) GetI

func (o *SCache) GetI(key int) (val interface{}, err error)

func (*SCache) GetSub

func (o *SCache) GetSub(keys ...interface{}) *SCache

func (*SCache) GetSubEx

func (o *SCache) GetSubEx(lock bool, index int, keys []interface{}) *SCache

func (*SCache) GetSubVal

func (o *SCache) GetSubVal(load bool, keys ...interface{}) (val interface{}, err error)

func (*SCache) GetSubValEx

func (o *SCache) GetSubValEx(load bool, factor int, timeout time.Duration, lock bool, keys []interface{}) (val interface{}, err error)

func (*SCache) Init

func (o *SCache) Init(lock bool) (interface{}, error)

func (*SCache) Keys

func (o *SCache) Keys(lock bool) ([]interface{}, error)

func (*SCache) List

func (o *SCache) List(load bool, keys ...string) (val []interface{}, err error)

func (*SCache) ListEx

func (o *SCache) ListEx(load bool, factor int, timeout time.Duration, keys []string) (vals []interface{}, err error)

func (*SCache) ListKV

func (o *SCache) ListKV(load bool, keys []string) (kv map[string]interface{}, err error)

func (*SCache) ListKVEx

func (o *SCache) ListKVEx(load bool, factor int, timeout time.Duration, keys []string) (kv map[string]interface{}, err error)

func (*SCache) ListSubVal

func (o *SCache) ListSubVal(load bool, path []interface{}, keys []string) (val []interface{}, err error)

func (*SCache) ListSubValEx

func (o *SCache) ListSubValEx(load bool, factor int, timeout time.Duration, lock bool, path []interface{}, keys []string) (val []interface{}, err error)

keys_and_ids split by len == 0 string

func (*SCache) Load

func (o *SCache) Load(key interface{}, factor int, timeout time.Duration, lock bool) (val interface{}, err error)

func (*SCache) Set

func (o *SCache) Set(val interface{}, key interface{}) error

func (*SCache) SetEx

func (o *SCache) SetEx(val interface{}, key interface{}, lock bool) error

func (*SCache) SetI

func (o *SCache) SetI(val interface{}, key int, lock bool)

func (*SCache) SetSubVal

func (o *SCache) SetSubVal(lock bool, val interface{}, keys ...interface{})

func (*SCache) SetSubVals

func (o *SCache) SetSubVals(lock bool, vals []interface{}, keys []interface{}, pathes ...interface{})

func (*SCache) Sets

func (o *SCache) Sets(lock bool, vals []interface{}, keys []interface{}) error

func (*SCache) Values

func (o *SCache) Values() ([]interface{}, error)

type Updater

type Updater func(cache *SCache, flag int, val interface{}, lock bool, keys ...interface{}) error

Jump to

Keyboard shortcuts

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