Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Attribute ¶
type Attribute struct { gorm.Model Name string `gorm:"size:255;not null"` Quantity AttributeQuantity `gorm:"not null"` CreatedBy uint `gorm:"not null"` // Foreign key to the User model }
Attribute represents a single attribute that can be associated with a mood entry. This can be anything you might want associated with a mood entry.
type AttributeQuantity ¶
type AttributeQuantity int
const ( Low AttributeQuantity = iota + 1 Medium High )
type AuthProvider ¶
type DeletionConfirmation ¶
type ForgotPassword ¶
type Mood ¶
type Mood struct { gorm.Model UserID uint `gorm:"not null"` // Foreign key to the User model Mood MoodType `gorm:"not null"` Notes string `gorm:"size:255;"` // Notes are optional }
Mood represents a single mood entry made by a specific user.
type MoodAttribute ¶
type MoodAttribute struct { gorm.Model MoodID uint `gorm:"primaryKey;not null"` // Foreign key to the Mood model AttributeID uint `gorm:"primaryKey;not null"` // Foreign key to the Attribute model }
MoodAttribute represents the attributes of a mood entry. Many to many relationship with Mood.
type MoodResponse ¶
type MoodResponse struct { ID uint `json:"id"` Mood Mood `json:"mood"` Attributes []Attribute `json:"attributes"` }
MoodResponse represents the response body for a single mood entry.
type MoodType ¶
type MoodType int
MoodType represents the type of mood that a user can have. The mood types are: Angry, Sad, Neutral, Happy, Excited.
type PasswordAuth ¶
type PasswordAuth struct { gorm.Model Email string `gorm:"size:255;not null;unique;"` Password string `gorm:"size:255;not null;"` UserID uint `gorm:"unique;"` }
func (*PasswordAuth) HashPassword ¶
func (pa *PasswordAuth) HashPassword() error
type Resource ¶
type Resource struct { gorm.Model CreatedBy uint `gorm:"not null"` // Foreign key to the User model Title string `gorm:"size:255;not null"` Content string `gorm:"size:10000;not null"` URL string `gorm:"size:255;not null"` External bool `gorm:"not null"` // True if the resource is external, false default AdminPost bool `gorm:"not null"` // True if the resource is posted by an admin, false default }
type ResourceResponse ¶
type User ¶
type User struct { gorm.Model Email string `gorm:"size:255;not null;unique;"` Name string `gorm:"size:255;not null;"` ProfileImage string `gorm:"size:255;"` Verified bool `gorm:"default:false"` Admin bool `gorm:"default:false"` // TODO add admin route to disable user Disabled bool `gorm:"default:false"` // TODO disabled user should not be able to login/access routes => edit middleware }
Click to show internal directories.
Click to hide internal directories.