Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AuthUser ¶
AuthUser represents a user account for private visibility (used for login and update response) Its MarshalJSON function will expose its role.
func (*AuthUser) MarshalJSON ¶
type Post ¶
type Post struct {
ID int `json:"id"`
Title string `json:"title"`
Slug string `json:"slug"`
Body string `json:"body"`
UserID int `json:"userId"`
Author string `json:"author,omitempty"`
CreatedAt time.Time `json:"createdAt"`
UpdatedAt mysql.NullTime `json:"updatedAt"`
}
func (*Post) MarshalJSON ¶
type User ¶
type User struct {
ID int `json:"id"`
Name string `json:"name"`
Email string `json:"email"`
Password string `json:"password"`
Admin bool `json:"admin"`
CreatedAt time.Time `json:"createdAt"`
UpdatedAt mysql.NullTime `json:"updatedAt"`
}
User represents a user account for public visibility (used for public endpoints) Its MarshalJSON function wont expose its role.
func (*User) CheckPassword ¶
func (*User) MarshalJSON ¶
TODO: Maybe find a better solution to remove the password when marshalling to json
func (*User) SetPassword ¶
Click to show internal directories.
Click to hide internal directories.