session

package
v0.1.16 Latest Latest
Warning

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

Go to latest
Published: Apr 23, 2024 License: MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Manager *session.Manager
)
View Source
var MaxHistoryPath = 64

Functions

func GetHandler

func GetHandler(name string) (session.Handler, error)

func RegisterHandler

func RegisterHandler(name string, register HandlerRegister)

Types

type Config

type Config struct {
	Default     string `yaml:"default" env:"SESSION_HANDLER" default:"file"`
	Dir         string `yaml:"dir" default:"sessions"`
	MaxLifeTime int    `yaml:"max_life_time" default:"600"`
	CacheStore  string `yaml:"cache_store" default:"session"`
	CookieName  string `yaml:"cookie_name" default:"enorith-session" env:"COOKIE_NAME"`
	Domain      string `yaml:"domain" default:""`
	Path        string `yaml:"path" default:"/"`
	Secure      bool   `yaml:"secure" default:"false"`
	HttpOnly    bool   `yaml:"http_only" default:"true"`
	SameSite    string `yaml:"same_site" default:"lax"`
	Encrypted   bool   `yaml:"encrypted" default:"false"`
}

type HandlerRegister

type HandlerRegister func() (session.Handler, error)

type History added in v0.1.2

type History []string

func (History) Last added in v0.1.2

func (hp History) Last() string

func (History) Latest added in v0.1.2

func (hp History) Latest() string

func (History) RedirectBack added in v0.1.2

func (History) SessionKey added in v0.1.2

func (History) SessionKey() string

type Middleware

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

type Service

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

func NewService

func NewService(storagePath string) *Service

func (*Service) Lifetime

func (s *Service) Lifetime(ioc container.Interface, request contracts.RequestContract)

Lifetime container callback usually register request lifetime instance to IoC-Container (per-request unique) this function will run before every request handling

func (*Service) Register

func (s *Service) Register(app *framework.App) error

Register service when app starting, before http server start you can configure service, prepare global vars etc. running at main goroutine

type SessionID

type SessionID struct {
	ID string
}

type SessionInjector added in v0.1.2

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

func NewSessionInjector added in v0.1.2

func NewSessionInjector(id string) *SessionInjector

func (*SessionInjector) Injection added in v0.1.2

func (si *SessionInjector) Injection(abs interface{}, last reflect.Value) (reflect.Value, error)

func (*SessionInjector) When added in v0.1.2

func (si *SessionInjector) When(abs interface{}) bool

type SessionLoader added in v0.1.2

type SessionLoader interface {
	SessionKey() string
}

Jump to

Keyboard shortcuts

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