Documentation ¶
Index ¶
- type CategoryIndex
- type ErrorData
- type Pagination
- type PostIndex
- type PostIndexByCategory
- type PostIndexBySearch
- type PostIndexByTag
- type PostShow
- type Presenter
- func (p *Presenter) Error(w http.ResponseWriter, code int)
- func (p *Presenter) ExecuteCategoryIndex(w http.ResponseWriter, r *http.Request, c *CategoryIndex) error
- func (pt *Presenter) ExecuteHomeIndex(w http.ResponseWriter, r *http.Request, p *PostIndex) error
- func (pt *Presenter) ExecutePostIndex(w http.ResponseWriter, r *http.Request, p *PostIndex) error
- func (pt *Presenter) ExecutePostIndexByCategory(w http.ResponseWriter, r *http.Request, p *PostIndexByCategory) error
- func (pt *Presenter) ExecutePostIndexByKeyword(w http.ResponseWriter, r *http.Request, p *PostIndexBySearch) error
- func (pt *Presenter) ExecutePostIndexByTag(w http.ResponseWriter, r *http.Request, p *PostIndexByTag) error
- func (pt *Presenter) ExecutePostShow(w http.ResponseWriter, r *http.Request, p *PostShow) error
- func (p *Presenter) ExecuteTagIndex(w http.ResponseWriter, r *http.Request, t *TagIndex) error
- func (p *Presenter) IsAd() bool
- func (p *Presenter) StripTags(s string) string
- func (p *Presenter) Summary(s string) string
- func (p *Presenter) Unescape(text string) template.HTML
- type TagIndex
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CategoryIndex ¶
type CategoryIndex struct { Categories *model.Categories Pagination *Pagination }
CategoryIndex is a data for index template.
type Pagination ¶
type Pagination struct { Pager *model.Pagination QueryParams template.URL }
Pagination is a data for pagination template.
type PostIndex ¶
type PostIndex struct { Posts *model.Posts Pagination *Pagination }
PostIndex is a data for index template.
type PostIndexByCategory ¶
type PostIndexByCategory struct { CategoryName string Posts *model.Posts Pagination *Pagination }
PostIndexByCategory is a data for index template by category.
type PostIndexBySearch ¶
type PostIndexBySearch struct { Keyword string Posts *model.Posts Pagination *Pagination }
PostIndexBySearch is a data for index template by search.
type PostIndexByTag ¶
type PostIndexByTag struct { TagName string Posts *model.Posts Pagination *Pagination }
PostIndexByTag is a data for index template by tag.
type Presenter ¶
type Presenter struct {
// contains filtered or unexported fields
}
Presenter represents the singular of presenter.
func NewPresenter ¶
NewPresenter creates a Presenter.
func (*Presenter) Error ¶
func (p *Presenter) Error(w http.ResponseWriter, code int)
Error responses a error template.
func (*Presenter) ExecuteCategoryIndex ¶
func (p *Presenter) ExecuteCategoryIndex(w http.ResponseWriter, r *http.Request, c *CategoryIndex) error
ExecuteCategoryIndex responses a index template.
func (*Presenter) ExecuteHomeIndex ¶
ExecuteHomeIndex responses a index template.
func (*Presenter) ExecutePostIndex ¶
ExecutePostIndex responses a index template.
func (*Presenter) ExecutePostIndexByCategory ¶
func (pt *Presenter) ExecutePostIndexByCategory(w http.ResponseWriter, r *http.Request, p *PostIndexByCategory) error
ExecutePostIndexByCategory responses a index template by category.
func (*Presenter) ExecutePostIndexByKeyword ¶
func (pt *Presenter) ExecutePostIndexByKeyword(w http.ResponseWriter, r *http.Request, p *PostIndexBySearch) error
ExecutePostIndexByKeyword responses a index template by keyword.
func (*Presenter) ExecutePostIndexByTag ¶
func (pt *Presenter) ExecutePostIndexByTag(w http.ResponseWriter, r *http.Request, p *PostIndexByTag) error
ExecutePostIndexByTag responses a index template by tag.
func (*Presenter) ExecutePostShow ¶
ExecutePostShow responses a show template by tag.
func (*Presenter) ExecuteTagIndex ¶
ExecuteTagIndex responses a index template.
type TagIndex ¶
type TagIndex struct { Tags *model.Tags Pagination *Pagination }
TagIndex is a data for index template.