Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrTitleEmpty = errors.New("title cannot be empty") ErrItemDeleted = errors.New("item is deleted") ErrCannotCreateItem = errors.New("cannot create new TODO item") ErrCannotGetItemLikes = errors.New("cannot get item likes") ErrCannotGetItem = errors.New("cannot get TODO item") ErrCannotGetItems = errors.New("cannot get TODO items") ErrCannotUpdateItem = errors.New("cannot update TODO item") ErrCannotDeleteItem = errors.New("cannot delete TODO item") ErrRequesterIsNotOwner = errors.New("no permission, only TODO owner can do this") ErrItemIDInvalid = errors.New("invalid TODO id") )
Functions ¶
This section is empty.
Types ¶
type TodoItem ¶
type TodoItem struct { core.SQLModel UserID int `json:"-" gorm:"column:user_id;"` Title string `json:"title" gorm:"column:title;"` Description string `json:"description" gorm:"column:description;"` Status string `json:"status" gorm:"column:status;"` LikedCount int `json:"liked_count" gorm:"column:liked_count;"` Image *core.Images `json:"image" gorm:"column:image"` Owner *core.SimpleUser `json:"owner" gorm:"foreignKey:UserID;"` }
type TodoItemCreation ¶
type TodoItemCreation struct { ID int `json:"id" gorm:"column:id;"` UserID int `json:"-" gorm:"column:user_id;"` Title string `json:"title" gorm:"column:title;"` Description string `json:"description" gorm:"column:description;"` Image *core.Images `json:"image" gorm:"column:image"` }
func (TodoItemCreation) TableName ¶
func (TodoItemCreation) TableName() string
func (*TodoItemCreation) Validate ¶
func (i *TodoItemCreation) Validate() error
type TodoItemUpdate ¶
type TodoItemUpdate struct { Title *string `json:"title" gorm:"column:title;"` Description *string `json:"description" gorm:"column:description;"` Status *string `json:"status" gorm:"column:status;"` Image *core.Images `json:"image" gorm:"column:image"` }
func (TodoItemUpdate) TableName ¶
func (TodoItemUpdate) TableName() string
Click to show internal directories.
Click to hide internal directories.