redis

package
v0.4.28 Latest Latest
Warning

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

Go to latest
Published: Dec 23, 2024 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Driver drivers.DBDriver = "redis"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Connection

type Connection struct {
	Driver       drivers.DBDriver `json:"driver"`
	Host         string           `json:"host"`
	Port         int64            `json:"port"`
	Auth         string           `json:"auth"`
	DB           int64            `json:"db"`
	Retries      int64            `json:"retries"`
	DialTimeout  int64            `json:"dial_timeout"`
	ReadTimeout  int64            `json:"read_timeout"`
	WriteTimeout int64            `json:"write_timeout"`
	Pool         *ConnectionPool  `json:"pool"`
}

func (*Connection) GetDriver

func (i *Connection) GetDriver() drivers.DBDriver

func (*Connection) IsDebug

func (i *Connection) IsDebug() bool

func (*Connection) NewConnector

func (i *Connection) NewConnector(name string) (drivers.ConnectorInterface, error)

type ConnectionPool

type ConnectionPool struct {
	Size         int64 `json:"size"`
	MinIdleConns int64 `json:"min_idle_conns"`
	PoolTimeout  int64 `json:"pool_timeout"`
	IdleTimeout  int64 `json:"idle_timeout"`
}

type RedisConnector

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

func NewRedisConnector

func NewRedisConnector(connection string, config *Connection) (*RedisConnector, error)

func (*RedisConnector) Connect

func (i *RedisConnector) Connect() error

func (*RedisConnector) GetConnection

func (i *RedisConnector) GetConnection() string

func (*RedisConnector) GetDB

func (i *RedisConnector) GetDB() any

func (*RedisConnector) GetDriver

func (i *RedisConnector) GetDriver() drivers.DriverInterface

Jump to

Keyboard shortcuts

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