adblocker

package
v1.0.103 Latest Latest
Warning

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

Go to latest
Published: Jun 8, 2023 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

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"},
		},
		base.RegionApSingapore: {
			Timeout: 5 * time.Second,
			Host:    "open-ap-singapore-1.volcengineapi.com",
			Scheme:  "https",
			Header: http.Header{
				"Accept": []string{"application/json"},
			},
			Credentials: base.Credentials{Region: base.RegionApSingapore, Service: "AdBlocker"},
		},
		base.RegionUsEast1: {
			Timeout: 5 * time.Second,
			Host:    "open-us-east-1.volcengineapi.com",
			Scheme:  "https",
			Header: http.Header{
				"Accept": []string{"application/json"},
			},
			Credentials: base.Credentials{Region: base.RegionUsEast1, Service: "AdBlocker"},
		},
	}

	ApiInfoList = map[string]*base.ApiInfo{
		"AdBlock": {
			Method: http.MethodPost,
			Path:   "/",
			Query: url.Values{
				"Action":  []string{"AdBlock"},
				"Version": []string{"2021-01-06"},
			},
		},
	}
)
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

type DecisionData

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

Jump to

Keyboard shortcuts

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