Documentation ¶
Index ¶
- type Article
- type Comment
- type Plugin
- func (p *Plugin) CreateArticle()
- func (p *Plugin) CreateComment()
- func (p *Plugin) CreateTag()
- func (p *Plugin) DestroyArticle()
- func (p *Plugin) DestroyComment()
- func (p *Plugin) DestroyTag()
- func (p *Plugin) EditArticle()
- func (p *Plugin) EditComment()
- func (p *Plugin) EditTag()
- func (p *Plugin) IndexArticles()
- func (p *Plugin) IndexComments()
- func (p *Plugin) IndexTags()
- func (p *Plugin) LatestArticles()
- func (p *Plugin) LatestComments()
- func (p *Plugin) LatestTags()
- func (p *Plugin) NewArticle()
- func (p *Plugin) NewComment()
- func (p *Plugin) NewTag()
- func (p *Plugin) ShowArticle()
- func (p *Plugin) ShowTag()
- func (p *Plugin) UpdateArticle()
- func (p *Plugin) UpdateComment()
- func (p *Plugin) UpdateTag()
- type Tag
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Article ¶
type Article struct { ID uint `orm:"column(id)" json:"id"` Title string `json:"title"` Body string `json:"body"` Type string `json:"type"` UpdatedAt time.Time `orm:"auto_now" json:"updatedAt"` CreatedAt time.Time `orm:"auto_now_add" json:"createdAt"` User *nut.User `orm:"rel(fk)" json:"user"` Tags []*Tag `orm:"rel(m2m);column(tag_id);rel_table(forum_articles_tags)" json:"tags"` Comments []*Comment `orm:"reverse(many)" json:"comments"` }
Article article
type Comment ¶
type Comment struct { ID uint `orm:"column(id)" json:"id"` Body string `json:"body"` Type string `json:"type"` UpdatedAt time.Time `orm:"auto_now" json:"updatedAt"` CreatedAt time.Time `orm:"auto_now_add" json:"createdAt"` User *nut.User `orm:"rel(fk)" json:"user"` Article *Article `orm:"rel(fk)" json:"article"` }
Comment comment
type Plugin ¶
type Plugin struct {
nut.Controller
}
Plugin controller
func (*Plugin) CreateArticle ¶
func (p *Plugin) CreateArticle()
CreateArticle create @router /articles [post]
func (*Plugin) CreateComment ¶
func (p *Plugin) CreateComment()
CreateComment create @router /comments [post]
func (*Plugin) DestroyArticle ¶
func (p *Plugin) DestroyArticle()
DestroyArticle remove @router /articles/:id [delete]
func (*Plugin) DestroyComment ¶
func (p *Plugin) DestroyComment()
DestroyComment remove @router /comments/:id [delete]
func (*Plugin) DestroyTag ¶
func (p *Plugin) DestroyTag()
DestroyTag remove @router /tags/:id [delete]
func (*Plugin) EditArticle ¶
func (p *Plugin) EditArticle()
EditArticle edit @router /articles/edit/:id [get]
func (*Plugin) EditComment ¶
func (p *Plugin) EditComment()
EditComment edit @router /comments/edit/:id [get]
func (*Plugin) IndexArticles ¶
func (p *Plugin) IndexArticles()
IndexArticles list all cards @router /articles [get]
func (*Plugin) IndexComments ¶
func (p *Plugin) IndexComments()
IndexComments list all cards @router /comments [get]
func (*Plugin) IndexTags ¶
func (p *Plugin) IndexTags()
IndexTags list all cards @router /tags [get]
func (*Plugin) LatestArticles ¶
func (p *Plugin) LatestArticles()
LatestArticles latest @router /latest/articles [get]
func (*Plugin) LatestComments ¶
func (p *Plugin) LatestComments()
LatestComments latest @router /latest/comments [get]
func (*Plugin) LatestTags ¶
func (p *Plugin) LatestTags()
LatestTags latest @router /latest/tags [get]
func (*Plugin) NewArticle ¶
func (p *Plugin) NewArticle()
NewArticle new card @router /articles/new [get]
func (*Plugin) NewComment ¶
func (p *Plugin) NewComment()
NewComment new card @router /comments/new [get]
func (*Plugin) ShowArticle ¶
func (p *Plugin) ShowArticle()
ShowArticle show @router /articles/:id [get]
func (*Plugin) UpdateArticle ¶
func (p *Plugin) UpdateArticle()
UpdateArticle update @router /articles/:id [post]
func (*Plugin) UpdateComment ¶
func (p *Plugin) UpdateComment()
UpdateComment update @router /comments/:id [post]
type Tag ¶
type Tag struct { ID uint `orm:"column(id)" json:"id"` Name string `json:"name"` UpdatedAt time.Time `orm:"auto_now" json:"updatedAt"` CreatedAt time.Time `orm:"auto_now_add" json:"createdAt"` Articles []*Article `orm:"reverse(many);rel_table(forum_articles_tags)" json:"articles"` }
Tag tag