service

package
v0.0.0-...-b779c1c Latest Latest
Warning

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

Go to latest
Published: Apr 26, 2025 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Day             = 24 * time.Hour
	SessionDuration = 30 * Day
	RenewBefore     = 15 * Day
)

Variables

View Source
var ErrSessionExpired = errors.New("session expired")

Functions

This section is empty.

Types

type Password

type Password interface {
	HashPassword(password string) (string, error)
	VerifyPassword(password string, hash string) bool
}

func NewPasswordService

func NewPasswordService() Password

type Session

type Session interface {
	GenerateToken(userID int64) (string, error)
	ValidateToken(token string) (*models.Session, *dto.AuthPaylaod, error)
}

func NewSession

func NewSession(db *sql.DB) Session

Jump to

Keyboard shortcuts

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