sessionstore

package
v1.1.14 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 15, 2025 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type GobSerializer

type GobSerializer struct{}

func (GobSerializer) Deserialize

func (gs GobSerializer) Deserialize(d []byte, s *sessions.Session) error

func (GobSerializer) Serialize

func (gs GobSerializer) Serialize(s *sessions.Session) ([]byte, error)

type RedisStore

type RedisStore struct {
	Options *sessions.Options
	// contains filtered or unexported fields
}

func NewRedisStoreWithAddr added in v1.1.13

func NewRedisStoreWithAddr(addr string, db int, prefix string) *RedisStore

func NewRedisStoreWithClient added in v1.1.13

func NewRedisStoreWithClient(client *goredis.PuzzleRedisClient, prefix string) *RedisStore

func (*RedisStore) Get

func (s *RedisStore) Get(r *http.Request, name string) (session *sessions.Session, err error)

Get get a session from redis

func (*RedisStore) Key

func (s *RedisStore) Key(k string) string

func (*RedisStore) New

func (s *RedisStore) New(r *http.Request, name string) (*sessions.Session, error)

New create a new session

func (*RedisStore) Save

func (s *RedisStore) Save(r *http.Request, w http.ResponseWriter, session *sessions.Session) error

Save session to redis

type SessionSerializer

type SessionSerializer interface {
	Serialize(s *sessions.Session) ([]byte, error)
	Deserialize(b []byte, s *sessions.Session) error
}

SessionSerializer provides an interface for serialize/deserialize a session

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL