redis

package
v0.0.0-...-0871eb3 Latest Latest
Warning

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

Go to latest
Published: Feb 4, 2021 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type RD

type RD struct {
	Pool *redis.Pool
	Conn redis.Conn
}

RD is struct for Redis

func GetRedis

func GetRedis() *RD

GetRedis is to get instance. singleton architecture

This is for singleton design pattern

func New

func New(host string, port uint16, pass string, dbNo int) *RD

New is to create instance for singleton

func NewInstance

func NewInstance(host string, port uint16, pass string) *RD

NewInstance makes a new instance

func (*RD) Close

func (rd *RD) Close()

Close is to close connection

func (*RD) Connection

func (rd *RD) Connection(dbNo int)

Connection is to connect Redis server

func (*RD) ConnectionS

func (rd *RD) ConnectionS(dbNo int)

ConnectionS is to connect Redis server using Send func

func (*RD) Flush

func (rd *RD) Flush(dbNo int)

Flush is to flush data

func (*RD) GetAndCluster

func (rd *RD) GetAndCluster() (int, error)

GetAndCluster is for cluster TODO: not finished yet. work in progress.

Jump to

Keyboard shortcuts

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