Documentation ¶
Index ¶
- type Redis
- func (s *Redis) Close()
- func (s *Redis) Config(params map[string]string) error
- func (s *Redis) Dial() error
- func (s *Redis) GetConnection() (redisDriver.Conn, error)
- func (s *Redis) NotifyClose(c adapters.CloseListener)
- func (s *Redis) SetDialPolicy(policy dial.Policy)
- func (s *Redis) SetLogger(logger *log.Logger)
- func (s *Redis) SetOptions(opts ...adapters.ServiceOption) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Redis ¶
type Redis struct { // A mutex protecting dial attempts. sync.Mutex // contains filtered or unexported fields }
var Adapter *Redis
Adapter is a singleton instance of a redis service
func (*Redis) Config ¶
Set the service configuration. Changing the configuration settings for an already connected service will trigger a service shutdown. The service consumer is responsible for handing service close events and triggering a re-dial.
func (*Redis) Dial ¶
Connect to the service. If a dial policy has been specified, the service will keep trying to reconnect until a connection is established or the dial policy aborts the reconnection attempt.
func (*Redis) GetConnection ¶
func (s *Redis) GetConnection() (redisDriver.Conn, error)
Fetch a connection from the pool.
func (*Redis) NotifyClose ¶
func (s *Redis) NotifyClose(c adapters.CloseListener)
Register a listener for receiving close notifications. The service adapter will emit an error and close the channel if the service is cleanly shut down or close the channel if the connection is reset.
func (*Redis) SetDialPolicy ¶
Set a dial policy for this service.
func (*Redis) SetOptions ¶
Apply a list of options to the service.