session

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Apr 13, 2022 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Key struct {
		Prefix string `json:"prefix"`
		MaxAge int    `json:"max_age"`
	} `json:"key"`

	Redis struct {
		PoolSize   int           `json:"pool_size"`
		MinIdleNum int           `json:"min_idle_num"`
		DB         db.ConnConfig `json:"db"`
	} `json:"redis"`
}

type GobSerializer

type GobSerializer struct{}

** serializer

Gob serializer

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 JsonSerializer

type JsonSerializer struct{}

Json serializer

func (JsonSerializer) Deserialize

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

func (JsonSerializer) Serialize

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

type RedisSessionSerializer

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

type Service

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

** Service

func (*Service) GetStore

func (s *Service) GetStore() sessions.Store

func (*Service) Init

func (s *Service) Init(l logger.Interface, c *Config, serializer RedisSessionSerializer) error

Jump to

Keyboard shortcuts

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