redis

package
v0.0.0-...-96965a9 Latest Latest
Warning

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

Go to latest
Published: May 7, 2023 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultMaxOpenConn  = 100
	DefaultMaxIdleConn  = 10
	DefaultConnLifetime = 300
)

Variables

This section is empty.

Functions

func NewRedisConnection

func NewRedisConnection(conn *Config) (*goredis.Client, error)

NewRedisConnection --

Types

type Config

type Config struct {
	Host         string
	Port         int
	Username     string
	Password     string
	Database     int
	MaxOpenConn  int
	MaxIdleConn  int
	ConnLifetime int
}

func GetConfigWithPrefix

func GetConfigWithPrefix(prefix string) *Config

GetConfigWithPrefix --

func GetDefaultConfig

func GetDefaultConfig() *Config

GetDefaultConfig --

func (*Config) BuildDataSource

func (c *Config) BuildDataSource() string

BuildDataSource --

func (*Config) GetConnMaxLifetime

func (c *Config) GetConnMaxLifetime() time.Duration

GetConnMaxLifetime --

func (*Config) GetMaxIdleConn

func (c *Config) GetMaxIdleConn() int

GetMaxIdleConn --

func (*Config) GetMaxOpenConn

func (c *Config) GetMaxOpenConn() int

GetMaxOpenConn --

Jump to

Keyboard shortcuts

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