Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
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 Make sure not to expose the password field when marshalling to json
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.