package redis

import (
	
	
	
	
)
UniversalOptions information is required by UniversalClient to establish connections.
Either a single address or a seed list of host:port addresses of cluster/sentinel nodes.
Database to be selected after connecting to the server. Only single-node and failover clients.
The sentinel master name. Only failover clients.
--------------------------------------------------------------------
UniversalClient is an abstract client which - based on the provided options - can connect to either clusters, or sentinel-backed failover instances or simple single-instance servers. This can be useful for testing cluster-specific applications locally.
type UniversalClient interface {
	Cmdable
	Context() context.Context
	AddHook(Hook)
	Watch(ctx context.Context, fn func(*Tx) error, keys ...string) error
	Do(ctx context.Context, args ...interface{}) *Cmd
	Process(ctx context.Context, cmd Cmder) error
	Subscribe(ctx context.Context, channels ...string) *PubSub
	PSubscribe(ctx context.Context, channels ...string) *PubSub
	Close() error
}

var (
	_ UniversalClient = (*Client)(nil)
	_ UniversalClient = (*ClusterClient)(nil)
	_ UniversalClient = (*Ring)(nil)
)
NewUniversalClient returns a new multi client. The type of client returned depends on the following three conditions: 1. if a MasterName is passed a sentinel-backed FailoverClient will be returned 2. if the number of Addrs is two or more, a ClusterClient will be returned 3. otherwise, a single-node redis Client will be returned.
func ( *UniversalOptions) UniversalClient {
	if .MasterName != "" {
		return NewFailoverClient(.Failover())
	} else if len(.Addrs) > 1 {
		return NewClusterClient(.Cluster())
	}
	return NewClient(.Simple())