Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GeneratePassword ¶
GeneratePassword will generate a hashed password for us based on the user's input.
Types ¶
type User ¶
type User struct { ID int64 `json:"id" form:"id"` Firstname string `json:"firstname" form:"firstname"` Username string `json:"username" form:"username"` HashedPassword []byte `json:"-" form:"-"` CreatedAt time.Time `json:"created_at" form:"created_at"` }
User is our User example model. Keep note that the tags for public-use (for our web app) should be kept in other file like "web/viewmodels/user.go" which could wrap by embedding the datamodels.User or define completely new fields instead but for the sake of the example, we will use this datamodel as the only one User model in our application.
Click to show internal directories.
Click to hide internal directories.