Documentation ¶
Index ¶
- func NewPool(uri *url.URL) *redigo.Pool
- func NewPoolFromURL(uri *url.URL) *redigo.Pool
- func NewPoolWithBorrowFunc(u *url.URL, f BorrowFunc) *redigo.Pool
- func NoopOnBorrow(c redigo.Conn, t time.Time) error
- func PingOnBorrow(c redigo.Conn, t time.Time) error
- type BorrowFunc
- type LogWrapper
- type Logger
- type Sender
- type Subscriber
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewPoolWithBorrowFunc ¶ added in v0.0.4
func NewPoolWithBorrowFunc(u *url.URL, f BorrowFunc) *redigo.Pool
Types ¶
type BorrowFunc ¶ added in v0.0.4
func NewSamplingBorrow ¶ added in v0.0.4
func NewSamplingBorrow(mod float64) BorrowFunc
type LogWrapper ¶
LogWrapper wraps a standard Logger to implement the Logger interface.
func (*LogWrapper) Error ¶
func (l *LogWrapper) Error(ctx context.Context, format string, args ...interface{})
Error implements the Logger interface.
type Logger ¶
type Logger interface { Info(context.Context, string, ...interface{}) Warn(context.Context, string, ...interface{}) Error(context.Context, string, ...interface{}) }
Logger is a minimal interface for a logger
type Subscriber ¶
type Subscriber struct { Logger Logger // contains filtered or unexported fields }
Subscriber subscribes to a Redis key, and writes receive messages to a channel.
func NewSubscriber ¶
NewSubscriber creates a Subscriber that will use the provided redis.Pool to subscribe to the given key.
Any messages that are received by the Subscriber will be written to the channel.
Click to show internal directories.
Click to hide internal directories.