session

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Aug 24, 2024 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func EncodeSessionToken

func EncodeSessionToken(session Session, secretKey []byte) (string, error)

Types

type Session

type Session struct {
	PrincipalID uuid.UUID
	IssuedAt    time.Time
	ExpiresAt   time.Time
}

func DecodeSessionToken

func DecodeSessionToken(token string, secretKey []byte, now time.Time) (Session, error)

func NewSession

func NewSession(principalID uuid.UUID, issuedAt time.Time, expiresAt time.Time) Session

func (Session) IsExpired

func (s Session) IsExpired(now time.Time) bool

Jump to

Keyboard shortcuts

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