Documentation ¶ Index ¶ type Model type Todo type User func NewUser(username, password string) User func (u *User) CanLogin(password string) bool Constants ¶ This section is empty. Variables ¶ This section is empty. Functions ¶ This section is empty. Types ¶ type Model ¶ type Model struct { ID uuid.UUID `gorm:"type:uuid;default:uuid_generate_v4()"` CreatedAt time.Time UpdatedAt time.Time DeletedAt gorm.DeletedAt } type Todo ¶ type Todo struct { Model Title string `gorm:"uniqueIndex:title_owner"` IsCompleted bool OwnerID uuid.UUID `gorm:"uniqueIndex:title_owner"` Owner User `gorm:"constraint:OnUpdate:CASCADE,OnDelete:CASCADE"` } type User ¶ type User struct { Model Username string `gorm:"unique_index"` PasswordHash string } func NewUser ¶ func NewUser(username, password string) User func (*User) CanLogin ¶ func (u *User) CanLogin(password string) bool Source Files ¶ View all Source files base.go todo.go user.go Directories ¶ Show internal Expand all Path Synopsis forms views Click to show internal directories. Click to hide internal directories.