cache

package
v0.0.0-...-12a6c45 Latest Latest
Warning

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

Go to latest
Published: Sep 27, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Decr

func Decr(key string, expiration ...time.Duration) int

func Del

func Del(key string)

func Get

func Get(key string) string

func Incr

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

func RegConnCreator

func RegConnCreator(typeName string, creator ConnCreator)

func Set

func Set(key, value string, expiration ...time.Duration)

func SetNX

func SetNX(key, value string, expiration ...time.Duration) bool

Types

type ConnCreator

type ConnCreator func(configName string) (Connection, error)

type Connection

type Connection interface {
	Set(key, value string, expiration ...time.Duration)
	SetNX(key, value string, expiration ...time.Duration) bool
	Get(key string) string
	Incr(key string, expiration ...time.Duration) int
	Decr(key string, expiration ...time.Duration) int
	Del(key string)
}

func Conn

func Conn(name ...string) Connection

type RedisConnection

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

func (*RedisConnection) Decr

func (o *RedisConnection) Decr(key string, expiration ...time.Duration) int

func (*RedisConnection) Del

func (o *RedisConnection) Del(key string)

func (*RedisConnection) Get

func (o *RedisConnection) Get(key string) string

func (*RedisConnection) Incr

func (o *RedisConnection) Incr(key string, expiration ...time.Duration) int

func (*RedisConnection) Set

func (o *RedisConnection) Set(key, value string, expiration ...time.Duration)

func (*RedisConnection) SetNX

func (o *RedisConnection) SetNX(key, value string, expiration ...time.Duration) bool

Jump to

Keyboard shortcuts

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