func (s *RedisStore) Close() error {
	return s.client.Close()
}
Close closes the Redis store
package redisstore
import (
	"bytes"
	"context"
	"crypto/rand"
	"encoding/base32"
	"encoding/gob"
	"errors"
	"github.com/go-redis/redis/v8"
	"github.com/gorilla/sessions"
	"io"
	"net/http"
	"strings"
	"time"
)
type RedisStore struct {
	client redis.UniversalClient
	options sessions.Options
	keyPrefix string
	keyGen KeyGenFunc
	serializer SessionSerializer
}
type KeyGenFunc func() (string, error)
func NewRedisStore(ctx context.Context, client redis.UniversalClient) (*RedisStore, error) {
	rs := &RedisStore{
		options: sessions.Options{
			Path:   "/",
			MaxAge: 86400 * 30,
		},
		client:     client,
		keyPrefix:  "session:",
		keyGen:     generateRandomKey,
		serializer: GobSerializer{},
	}
	return rs, rs.client.Ping(ctx).Err()
}
func (s *RedisStore) Get(r *http.Request, name string) (*sessions.Session, error) {
	return sessions.GetRegistry(r).Get(s, name)
}
func (s *RedisStore) New(r *http.Request, name string) (*sessions.Session, error) {
	session := sessions.NewSession(s, name)
	opts := s.options
	session.Options = &opts
	session.IsNew = true
	c, err := r.Cookie(name)
	if err != nil {
		return session, nil
	}
	session.ID = c.Value
	err = s.load(r.Context(), session)
	if err == nil {
		session.IsNew = false
	} else if err == redis.Nil {
		err = nil  
	}
	return session, err
}
func (s *RedisStore) Save(r *http.Request, w http.ResponseWriter, session *sessions.Session) error {
	if session.Options.MaxAge <= 0 {
		if err := s.delete(r.Context(), session); err != nil {
			return err
		}
		http.SetCookie(w, sessions.NewCookie(session.Name(), "", session.Options))
		return nil
	}
	if session.ID == "" {
		id, err := s.keyGen()
		if err != nil {
			return errors.New("redisstore: failed to generate session id")
		}
		session.ID = id
	}
	if err := s.save(r.Context(), session); err != nil {
		return err
	}
	http.SetCookie(w, sessions.NewCookie(session.Name(), session.ID, session.Options))
	return nil
}
func (s *RedisStore) Options(opts sessions.Options) {
	s.options = opts
}
func (s *RedisStore) KeyPrefix(keyPrefix string) {
	s.keyPrefix = keyPrefix
}
func (s *RedisStore) KeyGen(f KeyGenFunc) {
	s.keyGen = f
}
func (s *RedisStore) Serializer(ss SessionSerializer) {
	s.serializer = ss
}