Documentation ¶
Index ¶
- func ErrNil(err error) bool
- func Register(name string, cacheHandler cacheHandler) error
- func Use(name string) (cacheHandler, error)
- type CacheHandler
- type Handler
- type Instance
- func (this *Instance) GetCache(name string) (CacheHandler, error)
- func (this *Instance) HandlerName() string
- func (this *Instance) Initiate(ctx context.Context) (newCtx context.Context, err error)
- func (this *Instance) NewCache(ctx context.Context, name string) (CacheHandler, error)
- func (this *Instance) OnRequestShutdown(c *routing.Context) error
- func (this *Instance) OnRequestStartup(c *routing.Context) error
- func (this *Instance) OnShutdown(ctx context.Context) (context.Context, error)
- func (this *Instance) OnStartup(ctx context.Context) (context.Context, error)
- func (this *Instance) Use(ctx context.Context, handlerName string) error
- type RedisHandler
- type RedisPool
- func (this *RedisPool) Del(key interface{}) (interface{}, error)
- func (this *RedisPool) Exists(key interface{}) (bool, error)
- func (this *RedisPool) Expire(key interface{}, expire int64) error
- func (this *RedisPool) Get(key interface{}) (interface{}, error)
- func (this *RedisPool) GetConfig() map[string]interface{}
- func (this *RedisPool) Hget(key interface{}, field interface{}) (interface{}, error)
- func (this *RedisPool) Hgetall(key interface{}) (interface{}, error)
- func (this *RedisPool) Hmget(key interface{}, args ...interface{}) (interface{}, error)
- func (this *RedisPool) Hmset(key interface{}, args ...interface{}) error
- func (this *RedisPool) Hset(key interface{}, field interface{}, value interface{}) error
- func (this *RedisPool) Keys(key interface{}) (interface{}, error)
- func (this *RedisPool) Sadd(key interface{}, value interface{}) error
- func (this *RedisPool) ScanStruct(src []interface{}, dest interface{}) error
- func (this *RedisPool) Set(key interface{}, value interface{}) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type CacheHandler ¶
type CacheHandler interface { GetConfig() map[string]interface{} Set(key interface{}, value interface{}) error Get(key interface{}) (interface{}, error) Keys(key interface{}) (interface{}, error) Expire(key interface{}, expire int64) error Del(key interface{}) (interface{}, error) Hset(key interface{}, field interface{}, value interface{}) error Hget(key interface{}, field interface{}) (interface{}, error) Hgetall(key interface{}) (interface{}, error) Exists(key interface{}) (bool, error) ScanStruct(src []interface{}, dest interface{}) error Sadd(key interface{}, value interface{}) error }
type Handler ¶
type Handler interface { Initiate(ctx context.Context) error NewCache(ctx context.Context, name string, config map[string]interface{}) (CacheHandler, error) GetCache(name string) (CacheHandler, error) }
func NewRedisHandler ¶
func NewRedisHandler() Handler
type Instance ¶
type Instance struct { Config *config.Instance Utility *utility.Instance // contains filtered or unexported fields }
func NewInstance ¶
func NewInstance() *Instance
func (*Instance) HandlerName ¶
func (*Instance) OnRequestShutdown ¶
func (*Instance) OnRequestStartup ¶
func (*Instance) OnShutdown ¶
type RedisHandler ¶
type RedisHandler struct {
// contains filtered or unexported fields
}
func (*RedisHandler) GetCache ¶
func (this *RedisHandler) GetCache(name string) (CacheHandler, error)
func (*RedisHandler) NewCache ¶
func (this *RedisHandler) NewCache(ctx context.Context, name string, config map[string]interface{}) (CacheHandler, error)
Click to show internal directories.
Click to hide internal directories.