Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IsValidPassword ¶
Types ¶
type RefreshToken ¶
type RefreshToken struct { UserId string Email string Token string CreatedAt time.Time RevokedAt *time.Time }
https://travix.io/encapsulating-dependencies-in-go-b0fd74021f5a
func NewRefreshToken ¶
func NewRefreshToken(userId string, email string, token string) (*RefreshToken, error)
func RevokeRefreshToken ¶
func RevokeRefreshToken(email string, token string) (*RefreshToken, error)
type User ¶
type User struct { Id primitive.ObjectID `bson:"_id,omitempty"` //https://stackoverflow.com/questions/55445429/unable-to-decode-the-objectid-subvalue-from-mongodb-results-in-golang Email string PasswordHash string Role string CreatedAt time.Time UpdatedAt time.Time }
omitempty to protect against zeroed _id insertion
Click to show internal directories.
Click to hide internal directories.