Documentation ¶
Index ¶
- Constants
- func AllCache(search string, page, rows int) (et.List, error)
- func Close()
- func Count(key string, expiration time.Duration) int
- func Delete(key string) (int64, error)
- func DeleteCtx(ctx context.Context, key string) (int64, error)
- func DeleteVerify(device string, key string) (int64, error)
- func Empty(match string) error
- func Exists(key string) bool
- func ExistsCtx(ctx context.Context, key string) bool
- func FromId() string
- func GenId(args ...interface{}) string
- func GenKey(args ...interface{}) string
- func Get(key, def string) (string, error)
- func GetCtx(ctx context.Context, key, def string) (string, error)
- func GetItem(key string) (et.Item, error)
- func GetItems(key string) (et.Items, error)
- func GetJson(key string) (et.Json, error)
- func GetVerify(device string, key string) (string, error)
- func HDelete(key, atr string) error
- func HDeleteCtx(ctx context.Context, key, atr string) error
- func HGet(key string) (map[string]string, error)
- func HGetAtrib(key, atr string) (string, error)
- func HGetCtx(ctx context.Context, key string) (map[string]string, error)
- func HSet(key string, val map[string]string) error
- func HSetAtrib(key, atr, val string) error
- func HSetCtx(ctx context.Context, key string, val map[string]string) error
- func HandlerAll(w http.ResponseWriter, r *http.Request)
- func HandlerDelete(w http.ResponseWriter, r *http.Request)
- func HandlerGet(w http.ResponseWriter, r *http.Request)
- func More(key string, second time.Duration) int
- func Set(key string, val interface{}, second time.Duration) error
- func SetCtx(ctx context.Context, key, val string, second time.Duration) error
- func SetD(key string, val interface{}) error
- func SetH(key string, val interface{}) error
- func SetM(key string, val interface{}) error
- func SetVerify(device, key, val string, duration time.Duration) error
- func SetW(key string, val interface{}) error
- func SetY(key string, val interface{}) error
- type Conn
- type Message
Constants ¶
const IsNil = redis.Nil
const PackageName = "cache"
Variables ¶
This section is empty.
Functions ¶
func AllCache ¶ added in v0.0.4
* * AllCache * @params device string * @params key string * @params val string * @return error *
func Count ¶
* * Count * @params key string * @params expiration time.Duration (second) * @return int64 *
func DeleteCtx ¶ added in v0.0.4
* * DeleteCtx * @params ctx context.Context * @params key string * @return int64, error *
func DeleteVerify ¶ added in v0.0.4
* * DeleteVerify * @params device string * @params key string * @return int64, error *
func ExistsCtx ¶ added in v0.0.9
* * ExistsCtx * @params ctx context.Context * @params key string * @return bool *
func FromId ¶ added in v0.0.9
func FromId() string
* * FromId return the id of the connection * @return string *
func GenId ¶ added in v0.0.4
func GenId(args ...interface{}) string
* * GenId * @params args ...interface{} * @return string *
func GenKey ¶ added in v0.0.4
func GenKey(args ...interface{}) string
* * GenKey * @params args ...interface{} * @return string *
func GetCtx ¶ added in v0.0.4
* * GetCtx * @params ctx context.Context * @params key string * @params def string * @return string, error *
func GetVerify ¶ added in v0.0.4
* * GetVerify * @params device string * @params key string * @return string, error *
func HDelete ¶ added in v0.0.4
* * HDelete * @params key string * @params atr string * @return error *
func HDeleteCtx ¶ added in v0.0.4
* * HDeleteCtx * @params ctx context.Context * @params key string * @params atr string * @return error *
func HGetAtrib ¶ added in v0.0.4
* * HGetAtrib * @params key string * @params atr string * @return string, error *
func HGetCtx ¶ added in v0.0.4
* * HGetCtx * @params ctx context.Context * @params key string * @return map[string]string, error *
func HSet ¶ added in v0.0.4
* * HSet * @params key string * @params val map[string]string * @return error *
func HSetAtrib ¶ added in v0.0.4
* * HSetAtrib * @params key string * @params atr string * @params val string * @return error *
func HSetCtx ¶ added in v0.0.4
* * HSetCtx * @params ctx context.Context * @params key string * @params val map[string]string * @return error *
func HandlerAll ¶ added in v0.0.4
func HandlerAll(w http.ResponseWriter, r *http.Request)
* * HandlerAll * @params w http.ResponseWriter * @params r *http.Request *
func HandlerDelete ¶ added in v0.0.4
func HandlerDelete(w http.ResponseWriter, r *http.Request)
* * HandlerDelete * @params w http.ResponseWriter * @params r *http.Request *
func HandlerGet ¶ added in v0.0.4
func HandlerGet(w http.ResponseWriter, r *http.Request)
* * HandlerGet * @params w http.ResponseWriter * @params r *http.Request *
func More ¶ added in v0.0.3
* * More * @params key string * @params second time.Duration * @return int *
func Set ¶
* * Set * @params key string * @params val interface{} * @params second time.Duration * @return error *
func SetCtx ¶ added in v0.0.4
* * SetCtx * @params ctx context.Context * @params key string * @params val string * @params second time.Duration * @return error *
func SetD ¶ added in v0.0.3
* * SetD * @params key string * @params val interface{} * @return error *
func SetH ¶ added in v0.0.3
* * SetH * @params key string * @params val interface{} * @return error *
func SetM ¶ added in v0.0.3
* * SetM * @params key string * @params val interface{} * @return error *
func SetVerify ¶ added in v0.0.4
* * SetVerify * @params device string * @params key string * @params val string * @params duration time.Duration * @return error *
Types ¶
type Conn ¶ added in v0.0.4
type Conn struct { *redis.Client // contains filtered or unexported fields }
func (*Conn) Pub ¶ added in v0.0.9
* * Pub * @param channel string * @param message interface{} * @return error *