Documentation ¶
Index ¶
- type API
- func (api *API) AddView(w http.ResponseWriter, r *http.Request)
- func (api *API) CreateArticle(w http.ResponseWriter, r *http.Request)
- func (api *API) GetArticle(w http.ResponseWriter, r *http.Request)
- func (api *API) Index(w http.ResponseWriter, r *http.Request)
- func (api *API) PublishNSQMes(topic string, mes []byte)
- type Attributes
- type Data
- type StaticsResponse
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type API ¶
func (*API) AddView ¶
func (api *API) AddView(w http.ResponseWriter, r *http.Request)
AddView adds new view to article statistics * * POST /counter/v1/statistics
func (*API) CreateArticle ¶
func (api *API) CreateArticle(w http.ResponseWriter, r *http.Request)
CreateArticle creates new article * * POST /counter/v1/article/add
func (*API) GetArticle ¶
func (api *API) GetArticle(w http.ResponseWriter, r *http.Request)
GetArticle fetchs article
* GET /counter/v1/statistics/article_id/:id
func (*API) Index ¶
func (api *API) Index(w http.ResponseWriter, r *http.Request)
* * POST /v1/counter
func (*API) PublishNSQMes ¶
type Attributes ¶
type Attributes struct {
Views []*model.ArticleView `bson:"count" json:"count" valid:"required"`
}
type Data ¶
type Data struct { ID string `bson:"article_id" json:"article_id" valid:"required"` Type string `bson:"type" json:"type" valid:"required"` DataAttributes *Attributes `bson:"attributes" json:"attributes" valid:"required"` }
type StaticsResponse ¶
type StaticsResponse struct {
Result *Data `bson:"data" json:"data" valid:"required"`
}
Click to show internal directories.
Click to hide internal directories.