redis

package
v0.5.7 Latest Latest
Warning

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

Go to latest
Published: Mar 30, 2025 License: GPL-3.0 Imports: 4 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNilConfig = errors.New("redis config cannot be nil")
)

Functions

This section is empty.

Types

type Config

type Config interface {
	URI() string
	Password() string
	Database() int
}

Config interface

type ConnConfig added in v0.5.0

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

ConnConfig struct

func NewConnConfig added in v0.5.0

func NewConnConfig(uri, password string, database int) *ConnConfig

NewConnConfig creates a new Redis config

func (*ConnConfig) Database added in v0.5.0

func (c *ConnConfig) Database() int

Database returns the database

func (*ConnConfig) Password added in v0.5.0

func (c *ConnConfig) Password() string

Password returns the password

func (*ConnConfig) URI added in v0.5.0

func (c *ConnConfig) URI() string

URI returns the URI

type ConnHandler added in v0.5.0

type ConnHandler interface {
	Connect() (*redis.Client, error)
	Client() (*redis.Client, error)
	Disconnect()
}

ConnHandler interface

type DefaultConnHandler added in v0.5.0

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

DefaultConnHandler struct

func NewDefaultConnHandler added in v0.5.0

func NewDefaultConnHandler(config Config) (
	*DefaultConnHandler,
	error,
)

NewDefaultConnHandler creates a new connection

func (*DefaultConnHandler) Client added in v0.5.0

func (d *DefaultConnHandler) Client() (*redis.Client, error)

Client returns the Redis client

func (*DefaultConnHandler) Connect added in v0.5.0

func (d *DefaultConnHandler) Connect() (*redis.Client, error)

Connect returns a new Redis client

func (*DefaultConnHandler) Disconnect added in v0.5.0

func (d *DefaultConnHandler) Disconnect()

Disconnect closes the Redis client connection

Jump to

Keyboard shortcuts

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