xdb

package
v0.0.0-...-0e18063 Latest Latest
Warning

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

Go to latest
Published: Apr 19, 2024 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BeginTx

func BeginTx(rdb *redis.Client, cb func(tx *redis.Tx) error, keys ...string) error

func Commit

func Commit(rdb *redis.Client, cb func(pipe redis.Pipeliner) error) error

func CommitTx

func CommitTx(tx *redis.Tx, cb func(pipe redis.Pipeliner) error) error

func Getter

func Getter[T any, PT SetGetter[T]](rdb *redis.Client, key string) (*T, bool, error)

func MysqlOverSsh

func MysqlOverSsh(dsn string, cli *ssh.Client) string

func NewRedisOptions

func NewRedisOptions(addr, user, pass string, db int) *redis.Options

func NewRedisOptionsWithUrl

func NewRedisOptionsWithUrl(url string) *redis.Options

func RedisOverSsh

func RedisOverSsh(opt *redis.Options, cli *ssh.Client) (*redis.Client, error)

func Setter

func Setter[T any](key string, t *T) func(redis.Pipeliner) error

Types

type SetGetter

type SetGetter[T any] interface {
	Init()
	*T
}

Jump to

Keyboard shortcuts

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