cache

package
v1.0.14 Latest Latest
Warning

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

Go to latest
Published: Feb 5, 2026 License: MIT Imports: 17 Imported by: 2

Documentation

Index

Constants

View Source
const IsNil = redis.Nil
View Source
const PackageName = "cache"

Variables

This section is empty.

Functions

func AllCache

func AllCache(search string, page, rows int) (et.List, error)

* * AllCache * @params search string, page int, rows int * @return error *

func Close

func Close()

* * Close *

func CollectionDelete added in v1.0.11

func CollectionDelete(name, key string) error

* * CollectionDelete * @params name string, key string * @return error *

func CollectionFind added in v1.0.11

func CollectionFind(name, key string) (string, error)

* * CollectionFind * @params name string, key string * @return string, error *

func CollectionGet added in v1.0.11

func CollectionGet(name string) (map[string]string, error)

* * CollectionGet * @params name string * @return map[string]string, error *

func CollectionPut added in v1.0.11

func CollectionPut(name, key, val string) error

* * CollectionPut * @params name string, key string, val string * @return error *

func CollectionSet added in v1.0.11

func CollectionSet(name string, val map[string]string) error

* * ColectionSet * @params key string, val map[string]string * @return error *

func Decr added in v0.1.15

func Decr(key string) int64

* * Decr * @params key string * @return int64 *

func DecrCtx added in v0.1.15

func DecrCtx(ctx context.Context, key string) int64

* * DecrCtx * @params ctx context.Context, key string * @return int64 *

func Delete

func Delete(key string) (int64, error)

* * Delete * @params key string * @return int64, error *

func DeleteCtx

func DeleteCtx(ctx context.Context, key string) (int64, error)

* * DeleteCtx * @params ctx context.Context, key string * @return int64, error *

func DeleteVerify

func DeleteVerify(device string, key string) (int64, error)

* * DeleteVerify * @params device string, key string * @return int64, error *

func Empty

func Empty(match string) error

* * Empty * @return error *

func Exists

func Exists(key string) bool

* * Exists * @params key string * @return bool *

func ExistsCtx

func ExistsCtx(ctx context.Context, key string) bool

* * ExistsCtx * @params ctx context.Context, key string * @return bool *

func Expire added in v0.1.18

func Expire(key string, expiration time.Duration) error

* * Expire * @params key string, expSecond int * @return error *

func ExpireCtx added in v0.1.18

func ExpireCtx(ctx context.Context, key string, expiration time.Duration) error

* * ExpireCtx * @params ctx context.Context, key string, expiration time.Duration * @return error *

func FromId

func FromId() string

* * FromId * @return string *

func Get

func Get(key, defaultvalue string) (string, error)

* * Get * @params key string, defaultvalue string * @return string, error *

func GetCtx

func GetCtx(ctx context.Context, key, def string) (string, error)

* * GetCtx * @params ctx context.Context, key string, def string * @return string, error *

func GetItem

func GetItem(key string) (et.Item, error)

* * GetItem * @params key string * @return Item, error *

func GetItems

func GetItems(key string) (et.Items, error)

* * GetItems * @params key string * @return Items, error *

func GetJson

func GetJson(key string) (et.Json, error)

* * GetJson * @params key string * @return Json, error *

func GetVerify

func GetVerify(device string, key string) (string, error)

* * GetVerify * @params device string, key string * @return string, error *

func HDeleteCtx

func HDeleteCtx(ctx context.Context, key, atr string) error

* * HDeleteCtx * @params ctx context.Context, key string, atr string * @return error *

func HGetCtx

func HGetCtx(ctx context.Context, key string) (map[string]string, error)

* * HGetCtx * @params ctx context.Context, key string * @return map[string]string, error *

func HSetCtx

func HSetCtx(ctx context.Context, key string, val map[string]string) error

* * HSetCtx * @params ctx context.Context, key string, val map[string]string * @return error *

func HealthCheck added in v0.1.18

func HealthCheck() bool

* * HealthCheck * @return bool *

func HttpAll added in v1.0.11

func HttpAll(w http.ResponseWriter, r *http.Request)

* * HttpAll * @params w http.ResponseWriter, r *http.Request *

func HttpDelete added in v1.0.11

func HttpDelete(w http.ResponseWriter, r *http.Request)

* * HttpDelete * @params w http.ResponseWriter, r *http.Request *

func HttpGet added in v1.0.11

func HttpGet(w http.ResponseWriter, r *http.Request)

* * HttpGet * @params w http.ResponseWriter, r *http.Request *

func Incr added in v0.1.15

func Incr(key string, expiration time.Duration) int64

* * Incr * @params key string, expiration time.Duration * @return int64 *

func IncrCtx added in v0.1.15

func IncrCtx(ctx context.Context, key string, expiration time.Duration) int64

* * IncrCtx * @params ctx context.Context, key string, expiration time.Duration * @return int64 *

func IncrDuration added in v0.1.15

func IncrDuration(key string, expiration time.Duration) int64

* * Incr * @params key string, expiration time.Duration * @return int64 *

func IsLoad added in v0.1.4

func IsLoad() bool

* * IsLoad * @return bool *

func LPush added in v0.1.18

func LPush(key, val string) error

* * LPush * @params key string, val string * @return error *

func LPushCtx added in v0.1.18

func LPushCtx(ctx context.Context, key string, val string) error

* * LPushCtx * @params ctx context.Context, key string, val string * @return error *

func LRange added in v0.1.18

func LRange(key string, start, stop int64) ([]string, error)

* * LRange * @params key string, start int64, stop int64 * @return []string, error *

func LRangeCtx added in v0.1.18

func LRangeCtx(ctx context.Context, key string, start int64, stop int64) ([]string, error)

* * LRangeCtx * @params ctx context.Context, key string, start int64, stop int64 * @return []string, error *

func LRem added in v0.1.18

func LRem(key, val string) error

* * LRem * @params key string, val string * @return error *

func LRemCtx added in v0.1.18

func LRemCtx(ctx context.Context, key string, val string) error

* * LRemCtx * @params ctx context.Context, key string, val string * @return error *

func LTrim added in v0.1.18

func LTrim(key string, start, stop int64) error

* * LTrim * @params key string, start int64, stop int64 * @return error *

func LTrimCtx added in v0.1.18

func LTrimCtx(ctx context.Context, key string, start int64, stop int64) error

* * LTrimCtx * @params ctx context.Context, key string, start int64, stop int64 * @return error *

func Load

func Load() error

* * Load * @return error *

func ObjetAll added in v1.0.11

func ObjetAll(name string) ([]et.Json, error)

* * Objets * @params name string * @return []et.Json, error *

func ObjetDelete added in v1.0.11

func ObjetDelete(name, key string) error

* * ObjetDelete * @params name string, key string * @return error *

func ObjetGet added in v1.0.11

func ObjetGet(name, key string) (et.Json, error)

* * ObjetGet * @params name string, key string, v any * @return error *

func ObjetSet added in v1.0.11

func ObjetSet(name string, key string, obj et.Json) error

* * ObjetSet * @params name string, key string, val []byte * @return error *

func Set

func Set(key string, val interface{}, expiration time.Duration) interface{}

* * Set * @params key string, val interface{}, expiration time.Duration * @return interface{} *

func SetCtx

func SetCtx(ctx context.Context, key, val string, expiration time.Duration) string

* * SetCtx * @params ctx context.Context, key string, val string, expiration time.Duration * @return string *

func SetD

func SetD(key string, val interface{}, expiration int) interface{}

* * SetD * @params key string, val interface{}, expiration int64 * @return interface{} *

func SetDuration

func SetDuration(key string, val interface{}, expiration time.Duration) interface{}

* * SetDuration * @params key string, val interface{}, expMilisecond int64 * @return interface{} *

func SetH

func SetH(key string, val interface{}, expiration int) interface{}

* * SetH * @params key string, val interface{}, expiration int * @return interface{} *

func SetM

func SetM(key string, val interface{}, expiration int) interface{}

* * SetM * @params key string, val interface{}, expiration int64 * @return interface{} *

func SetVerify

func SetVerify(device, key, val string, expiration time.Duration) interface{}

* * SetVerify * @params device string, key string, val string, expiration time.Duration * @return interface{} *

func SetW

func SetW(key string, val interface{}, expiration int) interface{}

* * SetW * @params key string, val interface{}, expiration int64 * @return interface{} *

func SetY

func SetY(key string, val interface{}, expiration int) interface{}

* * SetY * @params key string, val interface{}, expiration int64 * @return interface{} *

Types

type Conn

type Conn struct {
	*redis.Client
	Id string
	// contains filtered or unexported fields
}

func ConnectTo

func ConnectTo(host, password string, db int) (*Conn, error)

* * Connect to a host * @param host, password string, db int * @return *Conn, error *

func (*Conn) Pub

func (s *Conn) Pub(channel string, message []byte) error

* * Pub * @param channel string * @param message interface{} * @return error *

func (*Conn) Sub

func (s *Conn) Sub(channel string, f func(*redis.Message))

* * Sub * @param channel string * @param f func(interface{}) *

func (*Conn) Unsub

func (s *Conn) Unsub(channel string) error

* * Unsub * @param channel string * @return error *

type Message

type Message struct {
	ID      string `json:"id"`
	Content string `json:"content"`
}

func (Message) ToJson

func (s Message) ToJson() (et.Json, error)

* * ToJson * @return et.Json, error *

func (Message) ToString added in v0.1.2

func (s Message) ToString() string

* * ToString * @return string *

Jump to

Keyboard shortcuts

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