Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ChangePasswordRequest ¶
type Habit ¶
type Habit struct {
ID uint `gorm:"primaryKey" json:"id"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
DeletedAt gorm.DeletedAt `gorm:"index" json:"-"`
Name string `gorm:"size:128;not null" json:"name"`
UserID uint `gorm:"index" json:"user_id"`
Entries []Entry `json:"-"`
}
type HabitAllResponse ¶ added in v0.2.0
type HabitRequest ¶
type HabitRequest struct {
Name string `json:"name"`
}
func (*HabitRequest) GetHabitStruct ¶
func (req *HabitRequest) GetHabitStruct() *Habit
type HabitResponse ¶
type HabitResponse struct {
ID uint `gorm:"primaryKey" json:"id"`
Name string `json:"name"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
UserID uint `json:"user_id"`
// Stats
EntriesCount int64 `gorm:"-:all" json:"entries_count"`
Streak uint `gorm:"-:all" json:"streak"`
LongestStreak uint `gorm:"-:all" json:"longest_streak"`
}
type PatchUserRequest ¶ added in v0.3.0
type PatchUserRequest struct {
Timezone string `json:"timezone"`
}
type User ¶
type User struct {
ID uint `gorm:"primaryKey" json:"id"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
DeletedAt gorm.DeletedAt `gorm:"index" json:"-"`
Name string `gorm:"size:128;not null" json:"name"`
Email string `gorm:"size:128;not null;uniqueIndex" json:"email"`
Admin bool `gorm:"not null;default:false;index" json:"admin"`
Password string `gorm:"-" json:"-"`
PasswordHash string `gorm:"not null" json:"-"`
Timezone string `gorm:"size:128;not null;default:UTC" json:"timezone"`
Habits []Habit `json:"-"`
}
func (*User) CheckPasswordHash ¶
func (*User) HashPassword ¶
func (*User) ValidatePassword ¶
type UserLogin ¶
func (*UserLogin) GetUserStruct ¶
type UserRequest ¶
type UserRequest struct {
Name string `json:"name"`
Email string `json:"email"`
Password string `json:"password"`
Admin bool `json:"admin"`
Timezone string `json:"timezone"`
}
func (*UserRequest) GetUserStruct ¶
func (req *UserRequest) GetUserStruct() *User
Click to show internal directories.
Click to hide internal directories.