adblocker

package
v1.0.177 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 19, 2024 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

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

func UnmarshalResultInto(data []byte, result interface{}) error

Types

type AdBlockRequest

type AdBlockRequest struct {
	AppId      int64  `json:"AppId"`
	Service    string `json:"Service"`
	Parameters string `json:"Parameters"`
}

type AdBlockResponse

type AdBlockResponse struct {
	RequestId string       `json:"RequestId"`
	Code      int          `json:"Code"`
	Message   string       `json:"Message"`
	Data      DecisionData `json:"Data"`
}

type AdBlocker

type AdBlocker struct {
	*base.Client
	// contains filtered or unexported fields
}

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) Retry

func (p *AdBlocker) Retry() bool

func (*AdBlocker) SetRegion

func (p *AdBlocker) SetRegion(region string) error

func (*AdBlocker) SimpleRiskStat added in v1.0.104

type CommonProductStatisticsParams added in v1.0.104

type CommonProductStatisticsParams struct {
	StartDate     string `json:"start_date"`
	EndDate       string `json:"end_date"`
	NeedAppDetail bool   `json:"need_app_detail"`
	OperateTime   int64  `json:"operate_time"`
}

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 CommonProductStatisticsResultTotal struct {
	AccountId        int64  `json:"AccountId"`
	RequestCnt       int64  `json:"RequestCnt"`
	ChargeRequestCnt *int64 `json:"ChargeRequestCnt,omitempty"`
}

type Context added in v1.0.139

type Context struct {
	MatchedWords []string   `json:"MatchedWords"`
	LibName      string     `json:"LibName"`
	Description  string     `json:"Description"`
	Positions    []Position `json:"Positions"`
}

type DecisionData

type DecisionData struct {
	Decision string     `json:"Decision"`
	Detail   string     `json:"Detail"`
	Tags     []string   `json:"Tags"`
	Contexts []*Context `json:"Contexts"`
}

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 Position added in v1.0.139

type Position struct {
	StartPos int `json:"StartPos"`
	EndPos   int `json:"EndPos"`
}

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"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL