Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Client ¶
func Client(s bandmaster.Service) *redis.Pool
Client returns the underlying `redis.Pool` of the given service.
It assumes that the service is ready; i.e. it might return nil if it's actually not.
NOTE: This will panic if `s` is not a `redis.Service`.
func New ¶
func New(p *redis.Pool) bandmaster.Service
New creates a new Redis service using the provided `redis.Pool`. You may use the helpers for environment-based configuration to get a pre-configured `redis.Pool` with sane defaults.
It doesn't open any connection nor does it do any kind of I/O; i.e. it cannot fail.
Types ¶
type Env ¶
type Env struct { URI string `envconfig:"URI" default:"redis://localhost:6379"` MaxConnsIdle int `envconfig:"MAX_CONNS_IDLE" default:"32"` MaxConnsActive int `envconfig:"MAX_CONNS_ACTIVE" default:"32"` TimeoutIdle time.Duration `envconfig:"TIMEOUT_IDLE" default:"45s"` TimeoutRead time.Duration `envconfig:"TIMEOUT_READ" default:"2s"` TimeoutWrite time.Duration `envconfig:"TIMEOUT_WRITE" default:"2s"` Wait bool `envconfig:"WAIT" default:"true"` }
Env can be used to configure a Redis session via the environment.
It comes with sane defaults for a local development set-up.
type Service ¶
type Service struct { *bandmaster.ServiceBase // "inheritance" // contains filtered or unexported fields }
Service implements a Redis service based on the 'garyburd/redigo' package.