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 ComplexTypeFeatures
- type Controller
- type DataSourceInfo
- type EmbeddingController
- type EmbeddingParam
- type EmbeddingResponse
- type ErrorResponse
- type Feature
- 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"` ComplexTypeFeatures ComplexTypeFeatures `json:"complex_type_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 ComplexTypeFeatures ¶ added in v2.2.5
func (*ComplexTypeFeatures) UnmarshalJSON ¶ added in v2.2.5
func (f *ComplexTypeFeatures) UnmarshalJSON(data []byte) error
type Controller ¶
func (*Controller) LogRequestBegin ¶
func (c *Controller) LogRequestBegin(r *http.Request)
func (*Controller) LogRequestBeginWithSize ¶ added in v2.2.5
func (c *Controller) LogRequestBeginWithSize(r *http.Request, size int)
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 int `json:"job_id"` }
type EmbeddingController ¶ added in v2.2.5
type EmbeddingController struct { Controller // contains filtered or unexported fields }
func (*EmbeddingController) CheckParameter ¶ added in v2.2.5
func (r *EmbeddingController) CheckParameter() error
func (*EmbeddingController) Process ¶ added in v2.2.5
func (c *EmbeddingController) Process(w http.ResponseWriter, r *http.Request)
type EmbeddingParam ¶ added in v2.2.5
type EmbeddingParam struct { RequestId string `json:"request_id"` SceneId string `json:"scene_id"` Uid string `json:"uid"` // user id Debug bool `json:"debug"` UserFeatures map[string]interface{} `json:"user_features"` UserComplexTypeFeatures ComplexTypeFeatures `json:"user_complex_type_features"` ItemId string `json:"item_id"` ItemFeatures map[string]interface{} `json:"item_features"` ItemComplexTypeFeatures ComplexTypeFeatures `json:"item_complex_type_features"` }
func (*EmbeddingParam) GetParameter ¶ added in v2.2.5
func (r *EmbeddingParam) GetParameter(name string) interface{}
type EmbeddingResponse ¶ added in v2.2.5
func (*EmbeddingResponse) ToBytes ¶ added in v2.2.5
func (r *EmbeddingResponse) ToBytes() []byte
func (*EmbeddingResponse) ToString ¶ added in v2.2.5
func (r *EmbeddingResponse) ToString() string
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.