redis

package
v0.0.0-...-1703ca6 Latest Latest
Warning

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

Go to latest
Published: Jan 26, 2025 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type R

type R interface {
	Ping(ctx context.Context) bool
	Client() *redis.Client
}

func MustApplyTestConfig

func MustApplyTestConfig(cfg config.C) (config.C, R)

func New

func New(ctx context.Context, c config.C) (R, error)

New creates a new database connection from the specified configuration. The type of the database returned will be determined by the configuration.

func NewForRoot

func NewForRoot(ctx context.Context, root *config.Root) (R, error)

NewForRoot creates a new database connection from the specified configuration. The type of the database returned will be determined by the configuration. Same as NewConnection.

func NewMiniredis

func NewMiniredis(redisConfig *config.RedisMiniredis, secretKey config.KeyData) (R, error)

NewMiniredis creates a new database connection to a SQLite database.

Parameters: - redisConfig: the configuration for the SQLite database - secretKey: the AES key used to secure cursors

func NewRedis

func NewRedis(ctx context.Context, redisConfig *config.RedisReal, secretKey config.KeyData) (R, error)

NewRedis creates a new redis connection to a real redis instance.

Parameters: - redisConfig: the configuration for the Redis instance - secretKey: the AES key used to secure cursors

Jump to

Keyboard shortcuts

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