driver

package
v0.0.0-...-5c90f72 Latest Latest
Warning

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

Go to latest
Published: Aug 28, 2022 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const NotExpired = 0

Variables

This section is empty.

Functions

func GetT

func GetT(data string, t encoding.BinaryUnmarshaler) (any, bool)

func ParseString

func ParseString(str string, result any) bool

Types

type Local

type Local struct {
	Options *LocalOptions
	// contains filtered or unexported fields
}

func NewLocalDriver

func NewLocalDriver(options LocalOptions) *Local

func (*Local) Delete

func (d *Local) Delete(key string) (ok bool)

func (*Local) Get

func (d *Local) Get(key string) (result any, ok bool)

func (*Local) GetT

func (d *Local) GetT(key string, result any) (ok bool)

func (*Local) Set

func (d *Local) Set(key string, value any, expiration time.Duration) (ok bool)

type LocalOptions

type LocalOptions struct {
	MaxSize int64
}

LocalOptions 初始化选项 [预留]

type Redis

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

func NewRedisDriver

func NewRedisDriver(options redis.Options) *Redis

func (*Redis) Delete

func (d *Redis) Delete(key string) (ok bool)

func (*Redis) Get

func (d *Redis) Get(key string) (result any, ok bool)

func (*Redis) GetT

func (d *Redis) GetT(key string, result any) (ok bool)

func (*Redis) Set

func (d *Redis) Set(key string, value any, expiration time.Duration) (ok bool)

type RedisCluster

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

func NewRedisClusterDriver

func NewRedisClusterDriver(options redis.ClusterOptions) *RedisCluster

func (*RedisCluster) Delete

func (d *RedisCluster) Delete(key string) (ok bool)

func (*RedisCluster) Get

func (d *RedisCluster) Get(key string) (result any, ok bool)

func (*RedisCluster) GetT

func (d *RedisCluster) GetT(key string, result any) (ok bool)

func (*RedisCluster) Set

func (d *RedisCluster) Set(key string, value any, expiration time.Duration) (ok bool)

Jump to

Keyboard shortcuts

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