redisManager

package module
v0.0.0-...-a9b9d1f Latest Latest
Warning

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

Go to latest
Published: Mar 5, 2020 License: MIT Imports: 2 Imported by: 0

README

go-redis-driver

import "github.com/qq1060656096/go-redis-manager"

manager := NewConnectionManager()
manager.Add("test1", &redis.Options{
	Addr:     "localhost:6379",
	Password: "123456", // no password set
	DB:       1,        // use default DB
})
manager.Add("test2", &redis.Options{
	Addr:     "localhost:6379",
	Password: "123456", // no password set
	DB:       2,        // use default DB
})

redisClient := manager.Get("test1").GetRedisClient().Set("test1.key1", "test1.value1", 0).Err()

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Connection

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

func (*Connection) DisconnectRedisClient

func (c *Connection) DisconnectRedisClient() bool

func (*Connection) GetRedisClient

func (c *Connection) GetRedisClient() *redis.Client

func (*Connection) ReconnectRedisClient

func (c *Connection) ReconnectRedisClient()

type ConnectionManager

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

func NewConnectionManager

func NewConnectionManager() *ConnectionManager

func (*ConnectionManager) Add

func (m *ConnectionManager) Add(name string, options *redis.Options)

func (*ConnectionManager) Exist

func (m *ConnectionManager) Exist(name string) bool

func (*ConnectionManager) Get

func (m *ConnectionManager) Get(name string) *Connection

func (*ConnectionManager) Length

func (m *ConnectionManager) Length() int

func (*ConnectionManager) Remove

func (m *ConnectionManager) Remove(name string)

func (ConnectionManager) String

func (m ConnectionManager) String() string

Jump to

Keyboard shortcuts

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