Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Article ¶
type Article struct { Id uint AuthorId uint //Author *User ` db:"-"` Title string Slug string Description string Body *string FavoritesCount int //FavoritedBy []*User TagList []string ` db:"-"` //Comments []Comment ` db:"-"` CreatedAt time.Time UpdatedAt time.Time }
func Article_Create ¶
func (Article) Update ¶
func (s Article) Update(src ArticlePatch) Article
Update returns an updated copy of the receiver. It does not change the slug when the title changes.
func (Article) WithAdjustedFavoriteCount ¶
type ArticlePatch ¶
type ArticlePlus ¶
type ArticlePlus struct { Id uint `json:"-"` Slug string `json:"slug"` Author Profile `json:"author"` Title string `json:"title"` Description string `json:"description"` Body *string `json:"body"` TagList []string `json:"tagList"` CreatedAt time.Time `json:"createdAt"` UpdatedAt time.Time `json:"updatedAt"` Favorited bool `json:"favorited"` FavoritesCount int `json:"favoritesCount"` }
func ArticlePlus_FromArticle ¶
func ArticlePlus_FromArticle(article Article, favorited bool, author Profile) ArticlePlus
func (ArticlePlus) ToArticle ¶
func (s ArticlePlus) ToArticle() Article
type Comment ¶
type Profile ¶
type Profile struct { UserId uint `json:"-"` Username string `json:"username"` Bio *string `json:"bio"` Image string `json:"image"` Following bool `json:"following"` }
func Profile_FromUser ¶
Click to show internal directories.
Click to hide internal directories.