redis

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Jun 25, 2025 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrInvalidScheme is returned when the Redis URI scheme is invalid
	ErrInvalidScheme = errors.New("invalid Redis database URI scheme")
)

Functions

func CreatePool

func CreatePool(options ConnectionOptions) (*redis.Pool, error)

CreatePool creates a Redis connection pool using the provided options

func DialRedis

func DialRedis(options ConnectionOptions) (redis.Conn, error)

DialRedis establishes a Redis connection using the provided options

func LoadCertPool

func LoadCertPool(certPath string) (*x509.CertPool, error)

LoadCertPool loads a certificate pool from a file

Types

type ConnectionOptions

type ConnectionOptions interface {
	GetURI() string
	GetMaxConnections() int
	GetMaxIdle() int
	GetIdleTimeout() time.Duration
	GetConnectTimeout() time.Duration
	GetReadTimeout() time.Duration
	GetWriteTimeout() time.Duration
	GetUseTLS() bool
	GetTLSSkipVerify() bool
	GetTLSCertPath() string
}

ConnectionOptions defines the interface for Redis connection options

Jump to

Keyboard shortcuts

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