ginplugin

package
v0.0.0-...-4d35d9b Latest Latest
Warning

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

Go to latest
Published: Mar 12, 2023 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewSessionId

func NewSessionId() string

func SessionHandler

func SessionHandler(sessionDomainService *SessionDomainService) func(ctx *gin.Context)

Types

type SessionData

type SessionData map[string][]byte

type SessionDomainService

type SessionDomainService struct {
	CookieName   string
	SessionStore SessionStore
	TTL          int

	ClientCookieMaxAge int
}

func NewSessionDomainService

func NewSessionDomainService(cookieName string, maxAge int, sessionStore SessionStore) *SessionDomainService

type SessionManager

type SessionManager interface {
	Set(key string, value []byte)
	Get(key string) []byte
	Delete(key string)
	SaveAndFreeze() error
}

func Session

func Session(ctx *gin.Context) SessionManager

type SessionStore

type SessionStore interface {
	Load(id string) (SessionData, error)
	Save(id string, sessionData SessionData, ttlInMillis int) error
	TouchIfExists(id string, ttlInMillis int) error
}

func NewMemSessionStore

func NewMemSessionStore() SessionStore

Jump to

Keyboard shortcuts

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