func (db *Database) Subscription() (*Subscription, error) {
	db.mux.Lock()
	defer db.mux.Unlock()
	return newSubscription(db)
}
Subscription returns a subscription with a connection to the
Redis server. It has to be closed with sub.Close() after usage.
package redis
import (
	"fmt"
	"sync"
	"time"
)
type Database struct {
	mux        sync.Mutex
	address    string
	network    string
	timeout    time.Duration
	index      int
	password   string
	poolsize   int
	logging    bool
	monitoring bool
	pool       *pool
}
func Open(options ...Option) (*Database, error) {
	db := &Database{
		address:    defaultSocket,
		network:    defaultNetwork,
		timeout:    defaultTimeout,
		index:      defaultIndex,
		password:   defaultPassword,
		poolsize:   defaultPoolSize,
		logging:    defaultLogging,
		monitoring: defaultMonitoring,
	}
	for _, option := range options {
		if err := option(db); err != nil {
			return nil, err
		}
	}
	db.pool = newPool(db)
	return db, nil
}
func (db *Database) Options() Options {
	db.mux.Lock()
	defer db.mux.Unlock()
	return Options{
		Address:    db.address,
		Network:    db.network,
		Timeout:    db.timeout,
		Index:      db.index,
		Password:   db.password,
		PoolSize:   db.poolsize,
		Logging:    db.logging,
		Monitoring: db.monitoring,
	}
}
func (db *Database) Connection() (*Connection, error) {
	db.mux.Lock()
	defer db.mux.Unlock()
	return newConnection(db)
}
func (db *Database) Pipeline() (*Pipeline, error) {
	db.mux.Lock()
	defer db.mux.Unlock()
	return newPipeline(db)
}