cache

package
v0.0.0-...-4ea7438 Latest Latest
Warning

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

Go to latest
Published: Dec 4, 2022 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (

	// ErrNotFound mean can not find the key
	ErrNotFound = fmt.Errorf("the key not found")
)

Functions

This section is empty.

Types

type EventHandler

type EventHandler interface {
	OnMessage(msg redis.Message)
}

EventHandler progress message

type Rediser

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

Rediser use redis

func NewCache

func NewCache(conn redis.Conn) *Rediser

NewCache create an cache to read redis

func NewSubCache

func NewSubCache(conn, subConn redis.Conn) *Rediser

NewSubCache create an cache support receive message

func (*Rediser) Del

func (c *Rediser) Del(key string) error

Del Del

func (*Rediser) Expire

func (c *Rediser) Expire(key string, ttl int) error

Expire Expire

func (*Rediser) Get

func (c *Rediser) Get(key string) (string, error)

Get Get

func (*Rediser) HDel

func (c *Rediser) HDel(key, filed string) error

HDel HDel

func (*Rediser) HGet

func (c *Rediser) HGet(key, filed interface{}) (string, error)

HGet HGet

func (*Rediser) HGetAll

func (c *Rediser) HGetAll(key interface{}) ([]string, error)

HGetAll HGetAll

func (*Rediser) HGetInt

func (c *Rediser) HGetInt(key, filed string) (int, error)

HGetInt HGetInt

func (*Rediser) HSet

func (c *Rediser) HSet(key, filed, value interface{}) error

HSet HSet

func (*Rediser) Set

func (c *Rediser) Set(key string, value interface{}, ttl int) error

Set Set

func (*Rediser) Subscription

func (c *Rediser) Subscription(channel string, handler EventHandler) error

Subscription redis event

Jump to

Keyboard shortcuts

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