rediscache

package
v0.0.0-...-a6b604f Latest Latest
Warning

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

Go to latest
Published: Feb 22, 2019 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrRedis is returned whenever there is an issue with the storage.
	// This can be for example an exhausted pool issues or a connection
	// failure.
	// Redis issues represents internal errors.
	ErrRedis = errors.Wrap(surf.ErrInternal, "redis")

	// ErrMiss is an alias.
	ErrMiss = errors.Wrap(surf.ErrMiss, "redis")

	// ErrConflict is an alias.
	ErrConflict = errors.Wrap(surf.ErrConflict, "redis")
)

Functions

func EnsureRedis

func EnsureRedis(t *testing.T) *redis.Pool

EnsureRedis creates a redis pool. Only if a pool with a successful connection can be created then the test is continued. If a connection is not successful test is skipped. Redis connection can be set via REDIS_URL environment variable. It is the clients responsibility to close the pool when no longer needed.

func NewRedisCache

func NewRedisCache(pool *redis.Pool) surf.CacheService

NewRedisCache returns a CacheService implementation that is using given redis pool as a storage backend.

Types

This section is empty.

Jump to

Keyboard shortcuts

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