redis

package
v0.0.6 Latest Latest
Warning

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

Go to latest
Published: Jul 1, 2021 License: MIT Imports: 15 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type JSONSerializer

type JSONSerializer struct {
	// contains filtered or unexported fields
}

func (JSONSerializer) Deserialize

func (s JSONSerializer) Deserialize(d []byte, ss *gsessions.Session) error

func (JSONSerializer) Logger

func (s JSONSerializer) Logger() fwncs.ILogger

func (JSONSerializer) Serialize

func (s JSONSerializer) Serialize(ss *gsessions.Session) ([]byte, error)

func (JSONSerializer) SetLogger

func (s JSONSerializer) SetLogger(log fwncs.ILogger)

type RedisOptions

type RedisOptions struct {
	Username          string
	Password          string
	Endpoints         []string
	GorillaOptions    *gsessions.Options
	KeyPairs          []byte
	KeyPrefix         string
	SessionSerializer SessionSerializer
	Dialer            func(ctx context.Context, network, addr string) (net.Conn, error)
	OnConnect         func(ctx context.Context, cn *redis.Conn) error
	TlsConfig         *tls.Config
}

type RedisStore

type RedisStore struct {
	// contains filtered or unexported fields
}

func GetRedisStore

func GetRedisStore(s Store) (err error, rediStore *RedisStore)

func (*RedisStore) Get

func (s *RedisStore) Get(req *http.Request, name string) (*gsessions.Session, error)

func (*RedisStore) GetSessionName added in v0.0.4

func (s *RedisStore) GetSessionName(session *gsessions.Session) string

func (*RedisStore) New

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

func (*RedisStore) Save

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

type SessionSerializer

type SessionSerializer interface {
	Serialize(ss *gsessions.Session) ([]byte, error)
	Deserialize(d []byte, ss *gsessions.Session) error
	Logger() fwncs.ILogger
	SetLogger(fwncs.ILogger)
}

type Store

type Store interface {
	sessions.Store
}

func NewStore

func NewStore(opts *RedisOptions) Store

Jump to

Keyboard shortcuts

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