Rd

package
v1.4812.1501 Latest Latest
Warning

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

Go to latest
Published: Dec 12, 2024 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const DEFAULT_HOST = `127.0.0.1:6379`

Variables

This section is empty.

Functions

This section is empty.

Types

type RdDockerTest

type RdDockerTest struct {
	// username and password must use conf https://stackoverflow.com/a/70808430/1620210
	Password string
	Database int
	Image    string

	Port string
	// contains filtered or unexported fields
}

func (*RdDockerTest) ConnectCheck

func (in *RdDockerTest) ConnectCheck(res *dockertest.Resource) (rueidis.Client, error)

func (*RdDockerTest) ImageLatest

func (in *RdDockerTest) ImageLatest(pool *D.DockerTest) *dockertest.RunOptions

func (*RdDockerTest) ImageVersion

func (in *RdDockerTest) ImageVersion(pool *D.DockerTest, version string) *dockertest.RunOptions

https://hub.docker.com/_/redis

func (*RdDockerTest) SetDefaults

func (in *RdDockerTest) SetDefaults(img string)

type RedisSession

type RedisSession struct {
	Pool   rueidis.Client
	Prefix string
}

func NewRedisSession

func NewRedisSession(host, pass string, dbNum int, prefix string) *RedisSession

NewRedisSession panic version

func TryRedisSession

func TryRedisSession(host, pass string, dbNum int, prefix string) (*RedisSession, error)

TryRedisSession non panic version, returns error if failed to connect

func (RedisSession) Dec

func (sess RedisSession) Dec(key string) int64

func (RedisSession) Del

func (sess RedisSession) Del(key string)

func (RedisSession) Expiry

func (sess RedisSession) Expiry(key string) int64

Expiry check the expiry time in second

func (RedisSession) FadeInt

func (sess RedisSession) FadeInt(key string, val int64, sec int64)

func (RedisSession) FadeMSX

func (sess RedisSession) FadeMSX(key string, val M.SX, sec int64)

func (RedisSession) FadeStr

func (sess RedisSession) FadeStr(key, val string, sec int64)

func (RedisSession) GetInt

func (sess RedisSession) GetInt(key string) int64

func (RedisSession) GetMSX

func (sess RedisSession) GetMSX(key string) M.SX

func (RedisSession) GetStr

func (sess RedisSession) GetStr(key string) string

func (RedisSession) Inc

func (sess RedisSession) Inc(key string) int64

func (RedisSession) Lpush

func (sess RedisSession) Lpush(key string, val string)

func (RedisSession) Lrange

func (sess RedisSession) Lrange(key string, start, end int64) []string

func (RedisSession) Product

func (sess RedisSession) Product() string

func (RedisSession) Rpush

func (sess RedisSession) Rpush(key string, val string)

func (RedisSession) SetInt

func (sess RedisSession) SetInt(key string, val int64)

func (RedisSession) SetMSS

func (sess RedisSession) SetMSS(key string, val M.SS)

func (RedisSession) SetMSX

func (sess RedisSession) SetMSX(key string, val M.SX)

func (RedisSession) SetStr

func (sess RedisSession) SetStr(key, val string)

Jump to

Keyboard shortcuts

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