cache

package
v0.0.0-...-ba408d3 Latest Latest
Warning

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

Go to latest
Published: Apr 14, 2026 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Decrement

func Decrement(parameters ...interface{})

func Flush

func Flush()

func Forever

func Forever(key string, value string)

func Forget

func Forget(key string)

func Get

func Get(key string) interface{}

func GetBool

func GetBool(key string) bool

func GetDuration

func GetDuration(key string) time.Duration

func GetFloat64

func GetFloat64(key string) float64

func GetInt

func GetInt(key string) int

func GetInt32

func GetInt32(key string) int32

func GetInt64

func GetInt64(key string) int64

func GetIntSlice

func GetIntSlice(key string) []int

func GetObject

func GetObject(key string, wanted interface{})

func GetString

func GetString(key string) string

func GetStringMap

func GetStringMap(key string) map[string]interface{}

func GetStringMapString

func GetStringMapString(key string) map[string]string

func GetStringMapStringSlice

func GetStringMapStringSlice(key string) map[string][]string

func GetStringSlice

func GetStringSlice(key string) []string

func GetTime

func GetTime(key string) time.Time

func GetUint

func GetUint(key string) uint

func GetUint32

func GetUint32(key string) uint32

func GetUint64

func GetUint64(key string) uint64

func Has

func Has(key string) bool

func Increment

func Increment(parameters ...interface{})

func InitWithCacheStore

func InitWithCacheStore(store Store)

func IsAlive

func IsAlive() error

func Set

func Set(key string, obj interface{}, expireTime time.Duration)

Types

type RedisStore

type RedisStore struct {
	RedisClient *redis.RedisClient
	KeyPrefix   string
}

func NewRedisStore

func NewRedisStore(address string, username string, password string, db int) *RedisStore

func (*RedisStore) Decrement

func (s *RedisStore) Decrement(parameters ...interface{})

func (*RedisStore) Flush

func (s *RedisStore) Flush()

func (*RedisStore) Forever

func (s *RedisStore) Forever(key string, value string)

func (*RedisStore) Forget

func (s *RedisStore) Forget(key string)

func (*RedisStore) Get

func (s *RedisStore) Get(key string) string

func (*RedisStore) Has

func (s *RedisStore) Has(key string) bool

func (*RedisStore) Increment

func (s *RedisStore) Increment(parameters ...interface{})

func (*RedisStore) IsAlive

func (s *RedisStore) IsAlive() error

func (*RedisStore) Set

func (s *RedisStore) Set(key string, value string, expireTime time.Duration)

type Service

type Service struct {
	Store Store
}
var Cache *Service

type Store

type Store interface {
	Set(key string, value string, expireTime time.Duration)
	Get(key string) string
	Has(key string) bool
	Forget(key string)
	Forever(key string, value string)
	Flush()

	IsAlive() error

	Increment(parameters ...interface{})
	Decrement(parameters ...interface{})
}

Jump to

Keyboard shortcuts

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