rpp

package module
v0.0.0-...-193c5ef Latest Latest
Warning

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

Go to latest
Published: Jan 19, 2018 License: MIT Imports: 5 Imported by: 0

README

rpp

rpp is a helper library for creating a Redis Pool (that is prepared).

Usage

const (
    MAX_ACTIVE = 5
    MAX_IDLE   = 5
)

var (
    err error
    rpp *redis.Pool
)

if rpp, err = RPP("redis://x:foo@10.10.10.10:8443/5", MAX_ACTIVE, MAX_IDLE); err != nil {
    fmt.Println("There was an error, err: ", err)
    return
}

conn := rpp.Get()

_, _ = conn.Do("HGETALL", "data:foo")

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrNoHostnameProvided is returned when a provided Redis URI does not
	// contain a hostname.
	ErrNoHostnameProvided = errors.New("no hostname provided")
)

Functions

func RPP

func RPP(redisURI string, maxActive, maxIdle int) (rp *redis.Pool, err error)

RPP returns a Redis connection pool that simplifies creating a connection pool when the URI contains authentication and specific database information.

Types

This section is empty.

Jump to

Keyboard shortcuts

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