Archived
Template
1
0

Improves documentation (#13)

* Documents all env variables and adds an example project

* Adds godoc comments

* Fixed package naming issue
This commit is contained in:
Markus Tenghamn
2022-01-09 14:42:03 +01:00
committed by GitHub
parent 5d01717111
commit e586933a6b
31 changed files with 248 additions and 78 deletions

View File

@ -5,6 +5,7 @@ import (
"time"
)
// Session holds information about user sessions and when they expire
type Session struct {
gorm.Model
Identifier string
@ -12,6 +13,7 @@ type Session struct {
ExpiresAt time.Time
}
// HasExpired is a helper function that checks if the current time is after the session expire datetime
func (s Session) HasExpired() bool {
return s.ExpiresAt.Before(time.Now())
}