Documentation ¶
Index ¶
- Constants
- Variables
- func UnmarshalResultInto(data []byte, result interface{}) error
- type AdBlockRequest
- type AdBlockResponse
- type AdBlocker
- type CommonProductStatisticsParams
- type CommonProductStatisticsReq
- type CommonProductStatisticsResultDetail
- type CommonProductStatisticsResultTotal
- type Context
- type DecisionData
- type OpenResult
- type Position
- type SimpleProductStatisticsParams
- type SimpleProductStatisticsResult
- type SimpleProductStatisticsResultDetail
- type SimpleProductStatisticsResultTotal
- type SimpleRiskStatResponse
- type SimpleRiskStatResult
Constants ¶
View Source
const ( MONTHLY = "month" DAILY = "day" )
unit type
View Source
const (
PrdAdblocker = "adblocker"
)
Product
Variables ¶
View Source
var ( ServiceInfoMap = map[string]*base.ServiceInfo{ base.RegionCnNorth1: { Timeout: 5 * time.Second, Host: "riskcontrol.volcengineapi.com", Scheme: "https", Header: http.Header{ "Accept": []string{"application/json"}, }, Credentials: base.Credentials{Region: base.RegionCnNorth1, Service: "AdBlocker"}, }, } ApiInfoList = map[string]*base.ApiInfo{ "AdBlock": { Method: http.MethodPost, Path: "/", Query: url.Values{ "Action": []string{"AdBlock"}, "Version": []string{"2021-01-06"}, }, }, "SimpleRiskStat": { Method: http.MethodGet, Path: "/", Timeout: 10 * time.Second, Query: url.Values{ "Action": []string{"SimpleRiskStat"}, "Version": []string{"2022-12-23"}, }, }, } )
View Source
var DefaultInstance = NewInstance()
Functions ¶
func UnmarshalResultInto ¶
Types ¶
type AdBlockRequest ¶
type AdBlockResponse ¶
type AdBlockResponse struct { RequestId string `json:"RequestId"` Code int `json:"Code"` Message string `json:"Message"` Data DecisionData `json:"Data"` }
type AdBlocker ¶
func NewInstance ¶
func NewInstance() *AdBlocker
func (*AdBlocker) AdBlock ¶
func (p *AdBlocker) AdBlock(req *AdBlockRequest) (*AdBlockResponse, error)
func (*AdBlocker) CloseRetry ¶
func (p *AdBlocker) CloseRetry()
func (*AdBlocker) SimpleRiskStat ¶ added in v1.0.104
func (p *AdBlocker) SimpleRiskStat(req *CommonProductStatisticsReq) (*SimpleRiskStatResponse, error)
type CommonProductStatisticsParams ¶ added in v1.0.104
type CommonProductStatisticsReq ¶ added in v1.0.104
type CommonProductStatisticsReq struct { Product string `json:"Product" form:"Product" query:"Product"` UnitType string `json:"UnitType" form:"UnitType" query:"UnitType"` Parameters string `json:"Parameters" form:"Parameters" query:"Parameters"` AppId *int64 `json:"AppId" form:"AppId" query:"AppId"` Service *string `json:"Service" form:"Service" query:"Service"` }
type CommonProductStatisticsResultDetail ¶ added in v1.0.104
type CommonProductStatisticsResultDetail struct { AccountId int64 `json:"AccountId"` RequestCnt int64 `json:"RequestCnt"` DateTime string `json:"DateTime"` ChargeRequestCnt *int64 `json:"ChargeRequestCnt,omitempty"` Service *string `json:"Service,omitempty"` AppId *int64 `json:"AppId,omitempty"` AppName *string `json:"AppName,omitempty"` }
type CommonProductStatisticsResultTotal ¶ added in v1.0.104
type DecisionData ¶
type OpenResult ¶ added in v1.0.104
type OpenResult struct { RequestId string `json:"RequestId"` Code int `json:"Code"` Message string `json:"Message"` }
func (*OpenResult) GetErr ¶ added in v1.0.104
func (result *OpenResult) GetErr() error
type SimpleProductStatisticsParams ¶ added in v1.0.104
type SimpleProductStatisticsParams struct { CommonProductStatisticsParams NeedServiceDetail bool `json:"need_service_detail"` }
type SimpleProductStatisticsResult ¶ added in v1.0.104
type SimpleProductStatisticsResult struct { Total *SimpleProductStatisticsResultTotal `json:"Total"` Detail []*SimpleProductStatisticsResultDetail `json:"Detail"` }
type SimpleProductStatisticsResultDetail ¶ added in v1.0.104
type SimpleProductStatisticsResultDetail CommonProductStatisticsResultDetail
type SimpleProductStatisticsResultTotal ¶ added in v1.0.104
type SimpleProductStatisticsResultTotal CommonProductStatisticsResultTotal
type SimpleRiskStatResponse ¶ added in v1.0.104
type SimpleRiskStatResponse struct {
Result *SimpleRiskStatResult `json:"Result"`
}
openapi
type SimpleRiskStatResult ¶ added in v1.0.104
type SimpleRiskStatResult struct { OpenResult Data *SimpleProductStatisticsResult `json:"Data"` }
Click to show internal directories.
Click to hide internal directories.