session

package
v0.0.0-...-9aa64a6 Latest Latest
Warning

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

Go to latest
Published: Jun 12, 2025 License: AGPL-3.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Session

type Session interface {
	IsExpired() bool
	UpdateLastUsed()
	GetUsername() string
	GetLastUsed() time.Time
}

func CreateNewSession

func CreateNewSession(username string, validityDuration time.Duration) (Session, string, error)

type SessionImpl

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

func (*SessionImpl) GetLastUsed

func (s *SessionImpl) GetLastUsed() time.Time

func (*SessionImpl) GetUsername

func (s *SessionImpl) GetUsername() string

func (*SessionImpl) IsExpired

func (s *SessionImpl) IsExpired() bool

func (*SessionImpl) UpdateLastUsed

func (s *SessionImpl) UpdateLastUsed()

type SessionManager

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

func NewSessionManager

func NewSessionManager() *SessionManager

func (*SessionManager) AddSession

func (s *SessionManager) AddSession(token string, session Session) error

func (*SessionManager) FindSession

func (s *SessionManager) FindSession(token string) Session

func (*SessionManager) RemoveSession

func (s *SessionManager) RemoveSession(token string) bool

Jump to

Keyboard shortcuts

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