Documentation ¶
Index ¶
- Constants
- Variables
- func RegisterCallBackProcessFunc(scene string, f CallBackProcessFunc)
- func Send(controller *CallBackController)
- type CallBackController
- type CallBackControllerHandler
- type CallBackParam
- type CallBackProcessFunc
- type CallBackResponse
- type Controller
- type DataSourceInfo
- type ErrorResponse
- type FeatureReplyController
- type FeatureReplyData
- type FeatureReplyParam
- type FeatureReplyResponse
- type ItemData
- type RecommendController
- type RecommendParam
- type RecommendResponse
- type Response
- type UserRecallController
- type UserRecallItemData
- type UserRecallParam
- type UserRecallResponse
Constants ¶
View Source
const ( SUCCESS_CODE int = 200 ERROR_PARAMETER_CODE int = 400 SERVER_ERROR_CODE int = 500 )
View Source
const (
Default_Size int = 10
)
Variables ¶
View Source
var ( CODE_MAPS = map[int]string{ SUCCESS_CODE: "success", ERROR_PARAMETER_CODE: "parammeter error", SERVER_ERROR_CODE: "server error", } )
Functions ¶
func RegisterCallBackProcessFunc ¶
func RegisterCallBackProcessFunc(scene string, f CallBackProcessFunc)
func Send ¶
func Send(controller *CallBackController)
Types ¶
type CallBackController ¶
type CallBackController struct { Controller // contains filtered or unexported fields }
func (*CallBackController) CheckParameter ¶
func (r *CallBackController) CheckParameter() error
func (*CallBackController) Process ¶
func (c *CallBackController) Process(w http.ResponseWriter, r *http.Request)
type CallBackControllerHandler ¶
type CallBackControllerHandler struct {
// contains filtered or unexported fields
}
func NewCallBackControllerHandler ¶
func NewCallBackControllerHandler() *CallBackControllerHandler
type CallBackParam ¶
type CallBackParam struct { SceneId string `json:"scene_id"` RequestId string `json:"request_id"` Uid string `json:"uid"` Features map[string]interface{} `json:"features"` ItemList []map[string]interface{} `json:"item_list"` RequestInfo map[string]interface{} `json:"request_info"` Debug bool `json:"debug"` }
func (*CallBackParam) GetParameter ¶
func (r *CallBackParam) GetParameter(name string) interface{}
type CallBackProcessFunc ¶
type CallBackResponse ¶
type CallBackResponse struct {
Response
}
func (*CallBackResponse) ToString ¶
func (r *CallBackResponse) ToString() string
type Controller ¶
func (*Controller) LogRequestBegin ¶
func (c *Controller) LogRequestBegin(r *http.Request)
func (*Controller) LogRequestEnd ¶
func (c *Controller) LogRequestEnd(r *http.Request)
func (*Controller) SendError ¶
func (c *Controller) SendError(w http.ResponseWriter, code int, msg string)
type DataSourceInfo ¶
type DataSourceInfo struct { Type string `json:"type"` AccessId string `json:"access_id"` AccessKey string `json:"access_key"` Endpoint string `json:"endpoint"` Project string `json:"project"` Topic string `json:"topic"` VpcAddress string `json:"vpc_address"` Token string `json:"token"` JobId uint32 `json:"job_id"` }
type ErrorResponse ¶
type ErrorResponse struct {
Response
}
func (*ErrorResponse) ToString ¶
func (e *ErrorResponse) ToString() string
type FeatureReplyController ¶
type FeatureReplyController struct { Controller // contains filtered or unexported fields }
func (*FeatureReplyController) CheckParameter ¶
func (r *FeatureReplyController) CheckParameter() error
func (*FeatureReplyController) Process ¶
func (c *FeatureReplyController) Process(w http.ResponseWriter, r *http.Request)
type FeatureReplyData ¶
type FeatureReplyParam ¶
type FeatureReplyParam struct { DataSource DataSourceInfo `json:"datasource"` FeatureData FeatureReplyData `json:"items"` }
func (*FeatureReplyParam) GetParameter ¶
func (r *FeatureReplyParam) GetParameter(name string) interface{}
type FeatureReplyResponse ¶
type FeatureReplyResponse struct {
Response
}
func (*FeatureReplyResponse) ToString ¶
func (r *FeatureReplyResponse) ToString() string
type RecommendController ¶
type RecommendController struct { Controller // contains filtered or unexported fields }
func (*RecommendController) CheckParameter ¶
func (r *RecommendController) CheckParameter() error
func (*RecommendController) Process ¶
func (c *RecommendController) Process(w http.ResponseWriter, r *http.Request)
type RecommendParam ¶
type RecommendParam struct { SceneId string `json:"scene_id"` Category string `json:"category"` Uid string `json:"uid"` // user id Size int `json:"size"` // get recommend items size Debug bool `json:"debug"` Features map[string]interface{} `json:"features"` }
func (*RecommendParam) GetParameter ¶
func (r *RecommendParam) GetParameter(name string) interface{}
type RecommendResponse ¶
func (*RecommendResponse) ToString ¶
func (r *RecommendResponse) ToString() string
type UserRecallController ¶
type UserRecallController struct { Controller // contains filtered or unexported fields }
func (*UserRecallController) CheckParameter ¶
func (r *UserRecallController) CheckParameter() error
func (*UserRecallController) Process ¶
func (c *UserRecallController) Process(w http.ResponseWriter, r *http.Request)
type UserRecallItemData ¶
type UserRecallParam ¶
type UserRecallParam struct { SceneId string `json:"scene_id"` Category string `json:"category"` Uid string `json:"uid"` // user id Size int `json:"size"` // get recommend items size }
func (*UserRecallParam) GetParameter ¶
func (r *UserRecallParam) GetParameter(name string) interface{}
type UserRecallResponse ¶
type UserRecallResponse struct { Response Size int `json:"size"` Items []*UserRecallItemData `json:"items"` Errors []error `json:"errors"` }
func (*UserRecallResponse) ToString ¶
func (r *UserRecallResponse) ToString() string
Source Files ¶
Click to show internal directories.
Click to hide internal directories.