tempdb: github.com/rafaeljesus/tempdb Index | Files

package tempdb

import "github.com/rafaeljesus/tempdb"

Index

Package Files

tempdb.go

Variables

var (
    // ErrKeyRequired is returned when key is not passed as parameter in tempdb.Config.
    ErrKeyRequired = errors.New("creating a new tempdb requires a non-empty key")
    // ErrValueRequired is returned when value is not passed as parameter in tempdb.Config.
    ErrValueRequired = errors.New("creating a new tempdb requires a non-empty value")
)

type Options Uses

type Options struct {
    Network            string
    Addr               string
    Dialer             func() (net.Conn, error)
    Password           string
    DB                 int
    MaxRetries         int
    DialTimeout        time.Duration
    ReadTimeout        time.Duration
    WriteTimeout       time.Duration
    PoolSize           int
    PoolTimeout        time.Duration
    IdleTimeout        time.Duration
    IdleCheckFrequency time.Duration
    ReadOnly           bool
    TLSConfig          *tls.Config
}

Options carries the different variables to tune a newly started redis client, it exposes the same configuration available from https://godoc.org/gopkg.in/redis.v5#Options go client.

type Tempdb Uses

type Tempdb interface {
    Insert(key, value string, expires time.Duration) (err error)
    Find(key string) (value string, err error)
}

Tempdb stores an expiring (or non-expiring) key/value pair in Redis.

func New Uses

func New(o Options) (tempdb Tempdb, err error)

New returns a new temp configured with the variables from the options parameter, or returning an non-nil err if an error occurred while creating redis client.

Package tempdb imports 7 packages (graph). Updated 2017-03-24. Refresh now. Tools for package owners.