Documentation
¶
Index ¶
- Variables
- func Get(name string, c echo.Context) (*sessions.Session, error)
- func Middleware(store sessions.Store) echo.MiddlewareFunc
- func MiddlewareWithConfig(config Config) echo.MiddlewareFunc
- func New(name string, c echo.Context) (*sessions.Session, error)
- type Config
- type GobSerializer
- type KeyGenFunc
- type RedisStore
- func (s *RedisStore) Close() error
- func (s *RedisStore) Get(r *http.Request, name string) (*sessions.Session, error)
- func (s *RedisStore) KeyGen(f KeyGenFunc)
- func (s *RedisStore) KeyPrefix(keyPrefix string)
- func (s *RedisStore) New(r *http.Request, name string) (*sessions.Session, error)
- func (s *RedisStore) Options(opts sessions.Options)
- func (s *RedisStore) Save(r *http.Request, w http.ResponseWriter, session *sessions.Session) error
- func (s *RedisStore) Serializer(ss SessionSerializer)
- type SessionSerializer
Constants ¶
This section is empty.
Variables ¶
View Source
var DefaultConfig = Config{Skipper: middleware.DefaultSkipper}
Functions ¶
func Middleware ¶
func Middleware(store sessions.Store) echo.MiddlewareFunc
func MiddlewareWithConfig ¶
func MiddlewareWithConfig(config Config) echo.MiddlewareFunc
Types ¶
type GobSerializer ¶
type GobSerializer struct{}
GobSerializer ...
func (GobSerializer) Deserialize ¶
func (gs GobSerializer) Deserialize(d []byte, s *sessions.Session) error
type KeyGenFunc ¶
type RedisStore ¶
type RedisStore struct {
// contains filtered or unexported fields
}
RedisStore stores gorilla sessions in Redis
func NewRedisStore ¶
func NewRedisStore(ctx context.Context, client redis.UniversalClient) (*RedisStore, error)
NewRedisStore returns a new RedisStore with default configuration
func (*RedisStore) KeyGen ¶
func (s *RedisStore) KeyGen(f KeyGenFunc)
KeyGen sets the key generator function
func (*RedisStore) KeyPrefix ¶
func (s *RedisStore) KeyPrefix(keyPrefix string)
KeyPrefix sets the key prefix to store session in Redis
func (*RedisStore) New ¶
New returns a session for the given name without adding it to the registry. nolint: errorlint
func (*RedisStore) Options ¶
func (s *RedisStore) Options(opts sessions.Options)
Options set options to use when a new session is created
func (*RedisStore) Save ¶
func (s *RedisStore) Save(r *http.Request, w http.ResponseWriter, session *sessions.Session) error
Save adds a single session to the response.
func (*RedisStore) Serializer ¶
func (s *RedisStore) Serializer(ss SessionSerializer)
Serializer sets the session serializer to store session
Click to show internal directories.
Click to hide internal directories.