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 ¶
MarshalJSON marshals a given user's information including role
type Post ¶
type Post struct { ID int `json:"id"` Title string `json:"title"` Slug string `json:"slug"` Body string `json:"body"` CreatedAt time.Time `json:"createdAt"` UpdatedAt pgtype.Timestamptz `json:"updatedAt"` Tags []string `json:"tags"` Hidden bool `json:"hidden"` AuthorID string `json:"authorid"` FeatureImgURL string `json:"featureImgUrl"` Subtitle string `json:"subtitle"` Views int `json:"views"` }
Post stores the data of a post
func (*Post) MarshalJSON ¶
MarshalJSON marshals post data
type User ¶
type User struct { ID uuid.UUID `json:"id"` Name string `json:"name"` Email string `json:"email"` Password string `json:"password"` Admin bool `json:"admin"` CreatedAt time.Time `json:"createdAt"` UpdatedAt *time.Time `json:"updatedAt"` Username string `json:"username"` }
User represents a user account for public visibility (used for public endpoints) Its MarshalJSON function wont expose its role.
func (*User) CheckPassword ¶
CheckPassword compares the given password with the user's password
func (*User) MarshalJSON ¶
MarshalJSON marshals a given user's information
func (*User) SetPassword ¶
SetPassword hashes and salts the given password and then sets it to the user
Click to show internal directories.
Click to hide internal directories.