// New returns a new Redis client.
New returns a new Redis client.
// New returns a new Redis client .
func New(opt *Option) (*Redis, error) {
	client := redis.NewClient(&redis.Options{
		Addr:     opt.Addr,
		Password: opt.Password,
		DB:       opt.DB,
	})
	err := client.Ping(context.Background()).Err()
	if err != nil {
		return nil, fmt.Errorf("redis ping error: %w", err)
	}
	return &Redis{client: client}, nil
}
func New ( opt * Option ) ( * Redis , error ) { client := redis . NewClient ( & redis . Options { Addr : opt . Addr , Password : opt . Password , DB : opt . DB , } ) err := client . Ping ( context . Background ( ) ) . Err ( ) if err != nil { return nil , fmt . Errorf ( " " , err ) } return & Redis { client : client } , nil }
New returns a new Redis client.
New returns a new Redis client .