db

package
v0.0.0-...-65a39b8 Latest Latest
Warning

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

Go to latest
Published: Oct 20, 2016 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DB

type DB struct {
	*pools.ResourcePool
}

DB is a wrapper over the connection pool.

func NewPool

func NewPool() *DB

NewPool returns a new Redis connection pool.

func (*DB) DecrementCounter

func (p *DB) DecrementCounter()

DecrementCounter decrements the counter by one.

func (*DB) IncrementCounter

func (p *DB) IncrementCounter()

IncrementCounter increments the counter by one.

func (*DB) InitCounter

func (p *DB) InitCounter()

InitCounter sets the `counter` key to zero.

func (*DB) ReadCounter

func (p *DB) ReadCounter() int64

ReadCounter returns the current contents of the counter in the database.

type Datastore

type Datastore interface {
	ReadCounter() int64
	IncrementCounter()
	DecrementCounter()
	InitCounter()
}

Datastore is an interface helper that allows mocking a test database.

type ResourceConn

type ResourceConn struct {
	redis.Conn
}

ResourceConn adapts a Redigo connection to a Vitess Resource.

func (ResourceConn) Close

func (r ResourceConn) Close()

Close closes a connection owned by a Vitess Resource.

Jump to

Keyboard shortcuts

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