Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Article ¶
type Article struct {
bun.BaseModel `bun:"table:articles,alias:a"`
ID domain.ID `bun:"id,pk"`
AuthorID domain.ID `bun:"author_id,notnull"`
Title string `bun:"title,notnull"`
Slug string `bun:"slug,notnull"`
Description string `bun:"description,notnull"`
Body string `bun:"body,notnull"`
CreatedAt time.Time `bun:"created_at,nullzero,notnull,default:current_timestamp"`
UpdatedAt time.Time `bun:"updated_at,nullzero,notnull,default:current_timestamp"`
}
type ArticleFavorite ¶
type ArticleFavorite struct {
bun.BaseModel `bun:"table:article_favorites,alias:af"`
ArticleID domain.ID `bun:"article_id,notnull"`
UserID domain.ID `bun:"user_id,notnull"`
}
func AsArticleFavorite ¶
func AsArticleFavorite(arg domain.ArticleFavorite) ArticleFavorite
func (ArticleFavorite) ToDomain ¶
func (data ArticleFavorite) ToDomain() domain.ArticleFavorite
type ArticleFavoriteCount ¶
type ArticleFavoriteCount struct {
bun.BaseModel `bun:"table:article_favorites,alias:af"`
ArticleID domain.ID `bun:"article_id"`
Count int `bun:"favorite_count"`
}
func AsArticleFavoriteCount ¶
func AsArticleFavoriteCount(arg domain.ArticleFavoriteCount) ArticleFavoriteCount
func (ArticleFavoriteCount) ToDomain ¶
func (data ArticleFavoriteCount) ToDomain() domain.ArticleFavoriteCount
type ArticleTag ¶
type ArticleTag struct {
bun.BaseModel `bun:"table:article_tags,alias:at"`
ArticleID domain.ID `bun:"article_id,notnull"`
TagID domain.ID `bun:"tag_id,notnull"`
}
func AsArticleTag ¶
func AsArticleTag(arg domain.ArticleTag) ArticleTag
func (ArticleTag) ToDomain ¶
func (data ArticleTag) ToDomain() domain.ArticleTag
type Comment ¶
type Comment struct {
bun.BaseModel `bun:"table:comments,alias:c"`
ID domain.ID `bun:"id,pk"`
ArticleID domain.ID `bun:"article_id,notnull"`
AuthorID domain.ID `bun:"author_id,notnull"`
Body string `bun:"body,notnull"`
CreatedAt time.Time `bun:"created_at,nullzero,notnull,default:current_timestamp"`
UpdatedAt time.Time `bun:"updated_at,nullzero,notnull,default:current_timestamp"`
}
type Tag ¶
type User ¶
type User struct {
bun.BaseModel `bun:"table:users,alias:u"`
ID domain.ID `bun:"id,pk"`
Email string `bun:"email,notnull"`
Username string `bun:"username,notnull"`
Password string `bun:"password,notnull"`
Image string `bun:"image"`
Bio string `bun:"bio"`
CreatedAt time.Time `bun:"created_at,nullzero,notnull,default:current_timestamp"`
UpdatedAt time.Time `bun:"updated_at,nullzero,notnull,default:current_timestamp"`
}
type UserFollow ¶
type UserFollow struct {
bun.BaseModel `bun:"table:user_follows,alias:uf"`
FollowerID domain.ID `bun:"follower_id"`
FolloweeID domain.ID `bun:"followee_id"`
}
func AsUserFollow ¶
func AsUserFollow(arg domain.UserFollow) UserFollow
func (UserFollow) ToDomain ¶
func (data UserFollow) ToDomain() domain.UserFollow
Click to show internal directories.
Click to hide internal directories.