redis

package module
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: May 22, 2019 License: MIT Imports: 11 Imported by: 0

README

Redis module provides you connection to Redis server

Codecov Build Status Report GitHub release GitHub

Module provides you connection to Redis server

  • *redis.Client is a Redis client representing a pool of zero or more underlying connections. It's safe for concurrent use by multiple goroutineshttps://img.shields.io/circleci/project/github/go-helium/redis.svg?style=flat-square

Configuration:

  • yaml example
redis:
  address: string
  password: string
  db: int
  max_retries: int
  min_retry_backoff: duration
  max_retry_backoff: duration
  dial_timeout: duration
  read_timeout: duration
  write_timeout: duration
  pool_size: int
  pool_timeout: duration
  idle_timeout: duration
  idle_check_frequency: duration
  • env example
REDIS_ADDRESS=string
REDIS_PASSWORD=string
REDIS_DB=int
REDIS_MAX_RETRIES=int
REDIS_MIN_RETRY_BACKOFF=duration
REDIS_MAX_RETRY_BACKOFF=duration
REDIS_DIAL_TIMEOUT=duration
REDIS_READ_TIMEOUT=duration
REDIS_WRITE_TIMEOUT=duration
REDIS_POOL_SIZE=int
REDIS_POOL_TIMEOUT=duration
REDIS_IDLE_TIMEOUT=duration
REDIS_IDLE_CHECK_FREQUENCY=duration

Documentation

Index

Constants

View Source
const (
	// ErrEmptyConfig when given empty options
	ErrEmptyConfig = Error("missing redis config key")
	// ErrEmptyAddresses when given empty addresses
	ErrEmptyAddresses = Error("missing addresses")
	// ErrPemParse when couldn't parse pem in sslrootcert
	ErrPemParse = Error("couldn't parse pem in sslrootcert")
	// ErrEmptyLogger when logger not initialized
	ErrEmptyLogger = Error("database empty logger")
	// ErrSSLKeyHasWorldPermissions when pk permissions no u=rw (0600) or less
	ErrSSLKeyHasWorldPermissions = Error("private key file has group or world access. Permissions should be u=rw (0600) or less")
)

Variables

View Source
var (
	// Module is default Redis client
	Module = module.Module{
		{Constructor: NewDefaultConfig},
		{Constructor: NewConnection},
	}
)

Functions

This section is empty.

Types

type Client

type Client = redis.UniversalClient

Client alias

func NewConnection

func NewConnection(opts *Config) (cache Client, err error)

NewConnection of redis client

type Config

type Config = redis.UniversalOptions

Config alias

func NewDefaultConfig

func NewDefaultConfig(v *viper.Viper) (*Config, error)

NewDefaultConfig for connection

type Error added in v0.3.0

type Error string

Error is constant error

func (Error) Error added in v0.3.0

func (e Error) Error() string

Error represented in string

Jump to

Keyboard shortcuts

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