Documentation
¶
Index ¶
- type Article
- type ArticleFilter
- type ArticleHandler
- func (h ArticleHandler) Create(w http.ResponseWriter, req bunrouter.Request) error
- func (h ArticleHandler) Delete(w http.ResponseWriter, req bunrouter.Request) error
- func (h ArticleHandler) Favorite(w http.ResponseWriter, req bunrouter.Request) error
- func (h ArticleHandler) Feed(w http.ResponseWriter, req bunrouter.Request) error
- func (h ArticleHandler) List(w http.ResponseWriter, req bunrouter.Request) error
- func (h ArticleHandler) Show(w http.ResponseWriter, req bunrouter.Request) error
- func (h ArticleHandler) Unfavorite(w http.ResponseWriter, req bunrouter.Request) error
- func (h ArticleHandler) Update(w http.ResponseWriter, req bunrouter.Request) error
- type ArticleTag
- type Comment
- type CommentHandler
- func (h CommentHandler) Create(w http.ResponseWriter, req bunrouter.Request) error
- func (h CommentHandler) Delete(w http.ResponseWriter, req bunrouter.Request) error
- func (h CommentHandler) List(w http.ResponseWriter, req bunrouter.Request) error
- func (h CommentHandler) Show(w http.ResponseWriter, req bunrouter.Request) error
- type FavoriteArticle
- type TagHandler
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Article ¶
type Article struct {
bun.BaseModel `bun:"articles,alias:a"`
ID uint64 `json:"-"`
Slug string `json:"slug"`
Title string `json:"title"`
Description string `json:"description"`
Body string `json:"body"`
Author *org.Profile `json:"author" bun:"rel:belongs-to"`
AuthorID uint64 `json:"-"`
Tags []ArticleTag `json:"-" bun:"rel:has-many"`
TagList []string `json:"tagList" bun:",scanonly,array"`
Favorited bool `json:"favorited" bun:",scanonly"`
FavoritesCount int `json:"favoritesCount" bun:",scanonly"`
CreatedAt time.Time `json:"createdAt"`
UpdatedAt time.Time `json:"updatedAt"`
}
type ArticleFilter ¶
type ArticleHandler ¶
type ArticleHandler struct {
// contains filtered or unexported fields
}
func NewArticleHandler ¶
func NewArticleHandler(app *bunapp.App) ArticleHandler
func (ArticleHandler) Create ¶
func (h ArticleHandler) Create(w http.ResponseWriter, req bunrouter.Request) error
func (ArticleHandler) Delete ¶
func (h ArticleHandler) Delete(w http.ResponseWriter, req bunrouter.Request) error
func (ArticleHandler) Favorite ¶
func (h ArticleHandler) Favorite(w http.ResponseWriter, req bunrouter.Request) error
func (ArticleHandler) Feed ¶
func (h ArticleHandler) Feed(w http.ResponseWriter, req bunrouter.Request) error
func (ArticleHandler) List ¶
func (h ArticleHandler) List(w http.ResponseWriter, req bunrouter.Request) error
func (ArticleHandler) Show ¶
func (h ArticleHandler) Show(w http.ResponseWriter, req bunrouter.Request) error
func (ArticleHandler) Unfavorite ¶
func (h ArticleHandler) Unfavorite(w http.ResponseWriter, req bunrouter.Request) error
func (ArticleHandler) Update ¶
func (h ArticleHandler) Update(w http.ResponseWriter, req bunrouter.Request) error
type ArticleTag ¶
type Comment ¶
type Comment struct {
bun.BaseModel `bun:"comments,alias:c"`
ID uint64 `json:"id"`
Body string `json:"body"`
Author *org.Profile `json:"author" bun:"rel:belongs-to"`
AuthorID uint64 `json:"-"`
ArticleID uint64 `json:"-"`
CreatedAt time.Time `json:"createdAt"`
UpdatedAt time.Time `json:"updatedAt"`
}
type CommentHandler ¶
type CommentHandler struct {
// contains filtered or unexported fields
}
func NewCommentHandler ¶
func NewCommentHandler(app *bunapp.App) CommentHandler
func (CommentHandler) Create ¶
func (h CommentHandler) Create(w http.ResponseWriter, req bunrouter.Request) error
func (CommentHandler) Delete ¶
func (h CommentHandler) Delete(w http.ResponseWriter, req bunrouter.Request) error
func (CommentHandler) List ¶
func (h CommentHandler) List(w http.ResponseWriter, req bunrouter.Request) error
func (CommentHandler) Show ¶
func (h CommentHandler) Show(w http.ResponseWriter, req bunrouter.Request) error
type FavoriteArticle ¶
type TagHandler ¶
type TagHandler struct {
// contains filtered or unexported fields
}
func NewTagHandler ¶
func NewTagHandler(app *bunapp.App) TagHandler
func (TagHandler) List ¶
func (h TagHandler) List(w http.ResponseWriter, req bunrouter.Request) error
Click to show internal directories.
Click to hide internal directories.