myredis

package module
v1.0.6 Latest Latest
Warning

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

Go to latest
Published: Apr 16, 2024 License: BSD-3-Clause Imports: 7 Imported by: 0

README

myredis

Documentation

Index

Constants

View Source
const (
	OneSecond = 1
	OneMinute = 60 * OneSecond
	OneHour   = 60 * OneMinute
	OneDay    = OneHour * 24
)

Variables

View Source
var (
	ErrNotFound = fmt.Errorf("the key not found")
)

Functions

func StreamToObject

func StreamToObject[E any](b []byte) (ret E, err error)

Types

type Client

type Client interface {
	Set(key string, v any, ttl int) error //ttl==0 ,永不过期
	SetAsJson(key string, v any, ttl int) error
	AcquireLock(key string, ttl int) (bool, error)
	ReleaseLock(key string) error
	Get(key string, v any) error
	GetFromJson(key string, v any) error
	Del(key string) error
	Exist(key string) (bool, error)
	RemainingTTL(key string) (int64, error)
	Expire(key string, ttl int) error
	Conn() error
}

func NewClient

func NewClient(address string, password string, db int) Client

Jump to

Keyboard shortcuts

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