Documentation ¶
Index ¶
- Variables
- func GenerateInnerLogger(logFileName, isJsonType, logMaxSize, logFileBackupCount, allowLogLevel string) log.Logger
- func PrintResult(i interface{})
- func ToJson(i interface{}) string
- type BadResponseError
- type Client
- type ClientError
- type ExposureClause
- type FbReadParser
- type Filter
- type FilterClause
- type FilterConnector
- type FilterOperator
- type InvalidParamsError
- type JsonReadParser
- type MatchItem
- type Metrics
- type MultiFilter
- type ReadParser
- type ReadRequest
- func (r *ReadRequest) AddQueryParam(key string, value string) *ReadRequest
- func (r *ReadRequest) AddRecallParam(param *RecallParam) *ReadRequest
- func (r *ReadRequest) BuildUri() url.URL
- func (r *ReadRequest) SetBizName(bizName string) *ReadRequest
- func (r *ReadRequest) SetFilterClause(clause *FilterClause) *ReadRequest
- func (r *ReadRequest) SetQueryParams(params map[string]string) *ReadRequest
- func (r *ReadRequest) SetRecallParams(recallParams []RecallParam) *ReadRequest
- func (r *ReadRequest) SetReturnCount(returnCount int) *ReadRequest
- func (r *ReadRequest) Validate() error
- type ReadResult
- type RecallParam
- func (p *RecallParam) SetRecallName(name string) *RecallParam
- func (p *RecallParam) SetRecallType(recallType RecallType) *RecallParam
- func (p *RecallParam) SetReturnCount(returnCount int) *RecallParam
- func (p *RecallParam) SetScorerClause(clause *ScorerClause) *RecallParam
- func (p *RecallParam) SetTriggerItems(items []string) *RecallParam
- func (p *RecallParam) Validate() error
- type RecallType
- type Response
- type Result
- type ScorerClause
- type SingleFilter
- type WriteRequest
- type WriteResult
- type WriteType
Constants ¶
This section is empty.
Variables ¶
View Source
var Logger = initDefaultBELogger()
Functions ¶
func GenerateInnerLogger ¶
func PrintResult ¶
func PrintResult(i interface{})
Types ¶
type BadResponseError ¶
BadResponseError define be http bad response error
func NewBadResponseError ¶
func NewBadResponseError(body string, header map[string][]string, httpCode int) *BadResponseError
func (BadResponseError) Error ¶
func (e BadResponseError) Error() string
func (BadResponseError) String ¶
func (e BadResponseError) String() string
type Client ¶
type Client struct { Endpoint string UserName string PassWord string EnableMetric bool // contains filtered or unexported fields }
func (*Client) InitMetrics ¶
func (c *Client) InitMetrics()
func (*Client) WithConnectionSize ¶
func (*Client) WithRequestTimeout ¶
WithRequestTimeout with custom timeout for a request
type ClientError ¶
type ClientError struct {
Message string `json:"errorMessage"`
}
ClientError defines be client error
func (ClientError) Error ¶
func (e ClientError) Error() string
func (ClientError) String ¶
func (e ClientError) String() string
type ExposureClause ¶
func NewExposureClause ¶
func NewExposureClause(values []string) *ExposureClause
func (*ExposureClause) BuildParams ¶
func (c *ExposureClause) BuildParams() string
type FbReadParser ¶
type FbReadParser struct { }
type FilterClause ¶
func NewFilterClause ¶
func NewFilterClause(filter Filter) *FilterClause
func (*FilterClause) BuildParams ¶
func (c *FilterClause) BuildParams() string
func (*FilterClause) GetFilter ¶
func (c *FilterClause) GetFilter() Filter
func (*FilterClause) SetClause ¶
func (c *FilterClause) SetClause(clause string) *FilterClause
func (*FilterClause) SetFilter ¶
func (c *FilterClause) SetFilter(filter *Filter) *FilterClause
type FilterConnector ¶
type FilterConnector string
const ( FilterConnectorAnd FilterConnector = "AND" FilterConnectorOR FilterConnector = "OR" )
type FilterOperator ¶
type FilterOperator string
const ( EQ FilterOperator = "=" NE FilterOperator = "!=" LT FilterOperator = "<" GT FilterOperator = ">" LE FilterOperator = "<=" GE FilterOperator = ">=" )
type InvalidParamsError ¶
type InvalidParamsError struct {
Message string
}
func (InvalidParamsError) Error ¶
func (e InvalidParamsError) Error() string
func (InvalidParamsError) String ¶
func (e InvalidParamsError) String() string
type JsonReadParser ¶
type JsonReadParser struct { }
type MatchItem ¶
type MatchItem struct { FieldNames []string `json:"field_names"` FieldValues [][]interface{} `json:"field_values"` }
type MultiFilter ¶
type MultiFilter struct { Filters []Filter `json:"filters"` Connector FilterConnector `json:"connector"` }
func (*MultiFilter) GetConditionValue ¶
func (f *MultiFilter) GetConditionValue() string
func (*MultiFilter) Validate ¶
func (f *MultiFilter) Validate() error
type ReadParser ¶
type ReadParser interface {
// contains filtered or unexported methods
}
type ReadRequest ¶
type ReadRequest struct { ReturnCount int `json:"return_count"` BizName string `json:"biz_name"` FilterClause *FilterClause `json:"filter_clause"` RecallParams []RecallParam `json:"recall_params"` ExposureClause *ExposureClause `json:"exposure_clause"` QueryParams map[string]string `json:"query_params"` IsRawRequest bool `json:"is_raw_request"` OutFmt string `json:"out_fmt"` }
func NewReadRequest ¶
func NewReadRequest(bizName string, returnCount int) *ReadRequest
func (*ReadRequest) AddQueryParam ¶
func (r *ReadRequest) AddQueryParam(key string, value string) *ReadRequest
func (*ReadRequest) AddRecallParam ¶
func (r *ReadRequest) AddRecallParam(param *RecallParam) *ReadRequest
func (*ReadRequest) BuildUri ¶
func (r *ReadRequest) BuildUri() url.URL
func (*ReadRequest) SetBizName ¶
func (r *ReadRequest) SetBizName(bizName string) *ReadRequest
func (*ReadRequest) SetFilterClause ¶
func (r *ReadRequest) SetFilterClause(clause *FilterClause) *ReadRequest
func (*ReadRequest) SetQueryParams ¶
func (r *ReadRequest) SetQueryParams(params map[string]string) *ReadRequest
func (*ReadRequest) SetRecallParams ¶
func (r *ReadRequest) SetRecallParams(recallParams []RecallParam) *ReadRequest
func (*ReadRequest) SetReturnCount ¶
func (r *ReadRequest) SetReturnCount(returnCount int) *ReadRequest
func (*ReadRequest) Validate ¶
func (r *ReadRequest) Validate() error
type ReadResult ¶
type RecallParam ¶
type RecallParam struct { RecallName string `json:"recall_name"` TriggerItems []string `json:"trigger_items"` RecallType RecallType `json:"recall_type"` ReturnCount int `json:"return_count"` ScorerClause *ScorerClause `json:"scorer_clause"` }
func NewRecallParam ¶
func NewRecallParam() *RecallParam
func (*RecallParam) SetRecallName ¶
func (p *RecallParam) SetRecallName(name string) *RecallParam
func (*RecallParam) SetRecallType ¶
func (p *RecallParam) SetRecallType(recallType RecallType) *RecallParam
func (*RecallParam) SetReturnCount ¶
func (p *RecallParam) SetReturnCount(returnCount int) *RecallParam
func (*RecallParam) SetScorerClause ¶
func (p *RecallParam) SetScorerClause(clause *ScorerClause) *RecallParam
func (*RecallParam) SetTriggerItems ¶
func (p *RecallParam) SetTriggerItems(items []string) *RecallParam
func (*RecallParam) Validate ¶
func (p *RecallParam) Validate() error
type RecallType ¶
type RecallType string
const ( RecallTypeX2I RecallType = "X2I" RecallTypeVector RecallType = "Vector" )
type ScorerClause ¶
type ScorerClause struct {
Clause string `json:"clause"`
}
func NewScorerClause ¶
func NewScorerClause(clause string) *ScorerClause
type SingleFilter ¶
type SingleFilter struct { Left string `json:"left"` Operator FilterOperator `json:"operator"` Right string `json:"right"` }
func (*SingleFilter) GetConditionValue ¶
func (f *SingleFilter) GetConditionValue() string
func (*SingleFilter) Validate ¶
func (f *SingleFilter) Validate() error
type WriteRequest ¶
type WriteRequest struct { WriteType WriteType `json:"write_type"` TableName string `json:"table_name"` Contents []map[string]string `json:"contents"` PrimaryKey string `json:"primary_key"` QueryParams map[string]string `json:"query_params"` }
func NewWriteRequest ¶
func (*WriteRequest) AddQueryParam ¶
func (r *WriteRequest) AddQueryParam(key string, value string) *WriteRequest
func (*WriteRequest) SetQueryParams ¶
func (r *WriteRequest) SetQueryParams(params map[string]string) *WriteRequest
func (*WriteRequest) Validate ¶
func (r *WriteRequest) Validate() error
type WriteResult ¶
type WriteResult struct {
Errno int `json:"errno"`
}
Source Files ¶
Click to show internal directories.
Click to hide internal directories.