Documentation ¶
Index ¶
- Constants
- func InjectGorm(db *gorm.DB, opt *option.DefaultOption, redisOption *option.RedisOption) *plugin
- type Group
- type Handle
- func (h *Handle) Debug(item ...interface{})
- func (h *Handle) JoinAffectKey(table string, key string) string
- func (h *Handle) JoinCountSecondKey(key string) string
- func (h *Handle) JoinModelKey(table string, primary interface{}) string
- func (h *Handle) JoinModelKeys(table string, primarys ...interface{}) []string
- func (h *Handle) JoinSearchKey(table string, key string, indexKeys []interface{}) string
- func (h *Handle) NewCreateHandle() *createHandle
- func (h *Handle) NewDeleteHandle() *deleteHandle
- func (h *Handle) NewQueryHandle() *queryHandle
- func (h *Handle) NewUpdateHandle() *updateHandle
- func (h *Handle) RefreshEvent(key string, search bool)
- func (h *Handle) RefreshRun()
- type JsonModel
- type JsonSearch
- type RedisClient
- type Result
Constants ¶
View Source
const (
CACHE_ROW_PLUGIN = "CACHE:ROW_PLUGIN"
)
Variables ¶
This section is empty.
Functions ¶
func InjectGorm ¶
func InjectGorm(db *gorm.DB, opt *option.DefaultOption, redisOption *option.RedisOption) *plugin
InjectGorm .
Types ¶
type Group ¶
type Group struct {
// contains filtered or unexported fields
}
Group represents a class of work and forms a namespace in which units of work can be executed with duplicate suppression.
func (*Group) Do ¶
func (g *Group) Do(key string, fn func() (interface{}, error)) (v interface{}, err error, shared bool)
Do executes and returns the results of the given function, making sure that only one execution is in-flight for a given key at a time. If a duplicate comes in, the duplicate caller waits for the original to complete and receives the same results. The return value shared indicates whether v was given to multiple callers.
type Handle ¶
type Handle struct {
// contains filtered or unexported fields
}
func (*Handle) JoinCountSecondKey ¶
func (*Handle) JoinModelKey ¶
func (*Handle) JoinModelKeys ¶
func (*Handle) JoinSearchKey ¶
func (*Handle) NewCreateHandle ¶
func (h *Handle) NewCreateHandle() *createHandle
func (*Handle) NewDeleteHandle ¶
func (h *Handle) NewDeleteHandle() *deleteHandle
func (*Handle) NewQueryHandle ¶
func (h *Handle) NewQueryHandle() *queryHandle
func (*Handle) NewUpdateHandle ¶
func (h *Handle) NewUpdateHandle() *updateHandle
func (*Handle) RefreshEvent ¶
func (*Handle) RefreshRun ¶
func (h *Handle) RefreshRun()
type JsonSearch ¶
type JsonSearch struct { Timeout int64 Primarys []interface{} }
type RedisClient ¶
type RedisClient interface { Eval(script string, keys []string, args ...interface{}) *redis.Cmd EvalSha(sha1 string, keys []string, args ...interface{}) *redis.Cmd ScriptExists(hashes ...string) *redis.BoolSliceCmd ScriptLoad(script string) *redis.StringCmd Set(key string, value interface{}, expiration time.Duration) *redis.StatusCmd Del(keys ...string) *redis.IntCmd FlushDB() *redis.StatusCmd HGetAll(key string) *redis.StringStringMapCmd HDel(key string, fields ...string) *redis.IntCmd HScan(key string, cursor uint64, match string, count int64) *redis.ScanCmd HGet(key, field string) *redis.StringCmd MGet(keys ...string) *redis.SliceCmd HSet(key, field string, value interface{}) *redis.BoolCmd Expire(key string, expiration time.Duration) *redis.BoolCmd }
RedisClient .
Click to show internal directories.
Click to hide internal directories.