database

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Mar 31, 2017 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Database

type Database interface {
	ReadKeys(match string) ([]string, error)
	ReadEntry(key string) ([]byte, error)
	ReadAllEntries(match string) (map[string]string, error)
	InsertEntry(key string, entry []byte) error
	DeleteEntry(key string) (int, error)
	Expire(key string, ttl time.Duration) error
}

Database functions to manage data stored in an external database

func NewMockDB added in v0.4.0

func NewMockDB() Database

NewMockDB returns an instance of a mock database

func NewRedisDB

func NewRedisDB(address string, password string) Database

NewRedisDB returns an instance of a Redis database

func NewRedisDBWithConn

func NewRedisDBWithConn(conn redis.Conn, address string, password string) Database

NewRedisDBWithConn returns an instance of a Redis database using an existing connection

func NewRedisDBWithPool

func NewRedisDBWithPool(pool *redis.Pool) Database

NewRedisDBWithPool returns an instance of a Redis database using an existing connection pool

Jump to

Keyboard shortcuts

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