gdt

package
v1.8.101 Latest Latest
Warning

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

Go to latest
Published: Apr 15, 2024 License: Zlib Imports: 9 Imported by: 0

README

腾讯广点通广告投放开放平台

Documentation

Index

Constants

View Source
const (
	Success            = 0
	AccessTokenExpire  = 11000 //	access token过期
	EmptyAccessToken   = 11005 //access token为空
	InvalidAccessToken = 11004 //access token错误
	RefreshTokenExpire = 11012 //	refresh token过期
	AuthCodeUsed       = 11013 //Authorization code can only be used once.
)

https://developers.e.qq.com/docs/reference/errorcode?version=1.3&_preview=1

View Source
const ApiPrefixUrl = "https://api.e.qq.com"

Variables

This section is empty.

Functions

func GetAccessToken

func GetAccessToken(tk token.Token, d data.D) (access.Token, error)

func GetAdvService added in v1.0.30

func GetAdvService() token.Service

func GetService added in v1.0.28

func GetService() token.Service

func IsTokenExpired

func IsTokenExpired(code int32) bool

func NewAdvToken added in v1.0.30

func NewAdvToken(app token.App) token.Token

func NewToken

func NewToken(app token.App) token.Token

func RefreshToken

func RefreshToken(tk token.Token, d data.D) (access.Token, error)

Types

type AccessToken

type AccessToken struct {
	AcsToken    string `json:"access_token"`
	RefToken    string `json:"refresh_token"`
	AcsExpireIn int64  `json:"access_token_expires_in"`
	RefExpireIn int64  `json:"refresh_token_expires_in"`
}

AccessToken * "access_token": "c17348106551c8755165fc090a23ac49",

"refresh_token": "67994d762a30165630e6e66223e72d4d",
"access_token_expires_in": 604800,
"refresh_token_expires_in": 2592000

func (AccessToken) GetAccessToken

func (a AccessToken) GetAccessToken() access.Value

access.Token interface implement

func (AccessToken) GetRefAccessToken

func (a AccessToken) GetRefAccessToken() access.Value

type AcsData

type AcsData struct {
	AccessToken
	AdInfo AuthorizerInfo `json:"authorizer_info,omitempty"`
}

type AuthorizerInfo

type AuthorizerInfo struct {
	AccountUin      int64    `json:"account_uin,omitempty"`
	AccountId       int64    `json:"account_id,omitempty"`
	ScopeList       []string `json:"scope_list,omitempty"`
	WechatAccountId string   `json:"wechat_account_id,omitempty"`
	AccountRoleType string   `json:"account_role_type,omitempty"`
	AccountType     string   `json:"account_type,omitempty"`
	RoleType        string   `json:"role_type,omitempty"`
}

type Response

type Response struct {
	Code int32  `json:"code"`
	Msg  string `json:"message"`
}

func (Response) ErrorIf added in v1.2.8

func (r Response) ErrorIf() error

func (Response) ReturnIf

func (r Response) ReturnIf(api *token.Api) error

Jump to

Keyboard shortcuts

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