Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Group ¶
type Time ¶
Time in a separate interface allows us to inject any time implementation. This is already used for testing.
type UUID ¶
UUID in a separate interface allows us to inject any uuid implementation. This is already used for testing.
type User ¶
type User struct { ID string `gorm:"primaryKey"` CreatedAt time.Time `json:"created_at"` UpdatedAt time.Time `json:"updated_at"` Username string `json:"username"` Email string `json:"email" gorm:"unique"` EncryptedPassword string `json:"-"` InvitedAt *time.Time `json:"invited_at,omitempty"` ConfirmedID string `json:"confirmedID,omitempty"` ConfirmedAt *time.Time `json:"confirmed_at,omitempty"` LastSignInAt *time.Time `json:"last_sign_in_at,omitempty"` Groups []Group `gorm:"many2many:user_groups;"` }
func (*User) Authenticate ¶
authenticate a user from a password
func (*User) Confirm ¶
Confirm resets the confimation token and the confirm timestamp confirmedID is the unique of the JWT used to confirm this account
func (*User) IsConfirmed ¶
IsConfirmed checks if a user has already being registered and confirmed.
Click to show internal directories.
Click to hide internal directories.