You've already forked golang-base-project
Adds godoc comments
This commit is contained in:
@ -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())
|
||||
}
|
||||
|
@ -5,6 +5,7 @@ import (
|
||||
"time"
|
||||
)
|
||||
|
||||
// Token holds tokens typically used for user activation and password resets
|
||||
type Token struct {
|
||||
gorm.Model
|
||||
Value string
|
||||
@ -14,11 +15,14 @@ type Token struct {
|
||||
ExpiresAt time.Time
|
||||
}
|
||||
|
||||
// HasExpired is a helper function that checks if the current time is after the token expiration time
|
||||
func (t Token) HasExpired() bool {
|
||||
return t.ExpiresAt.Before(time.Now())
|
||||
}
|
||||
|
||||
const (
|
||||
// TokenUserActivation is a constant used to identify tokens used for user activation
|
||||
TokenUserActivation string = "user_activation"
|
||||
TokenPasswordReset string = "password_reset"
|
||||
// TokenPasswordReset is a constant used to identify tokens used for password resets
|
||||
TokenPasswordReset string = "password_reset"
|
||||
)
|
||||
|
@ -6,6 +6,7 @@ import (
|
||||
"time"
|
||||
)
|
||||
|
||||
// User holds information relating to users that use the application
|
||||
type User struct {
|
||||
gorm.Model
|
||||
Email string
|
||||
|
@ -2,6 +2,7 @@ package models
|
||||
|
||||
import "gorm.io/gorm"
|
||||
|
||||
// Website holds information about different websites
|
||||
type Website struct {
|
||||
gorm.Model
|
||||
Title string
|
||||
|
Reference in New Issue
Block a user