# README
CDP openAPI for GO
欢迎使用CDP openAPI SDK for GO, 本文档为您介绍如何获取及调用SDK。 此SDK 适用于CDP私部场景。
前置准备
服务开通
如果调用高速openAPI,请确保已经开通在线服务。
获取安全凭证
Access Key(访问密钥)是访问CDP openAPI服务的安全凭证,包含Access Key ID(简称为AK)和Secret Access Key(简称为SK)两部分。 您可以登录CDP, 点击“项目中心”->"资产输出"->"渠道管理"->"自定义渠道", 点击“添加渠道应用”,创建并管理您的Access Key。
环境检查
Go 版本需要不低于1.15
获取与安装
go get -u github.com/volcengine/cdp-openapi-sdk-go
样例
package main
import (
"context"
"fmt"
cdpCli "github.com/volcengine/cdp-openapi-sdk-go"
"net/http"
"time"
)
func main() {
testAk := "your-ak"
testSk := "your-sk"
basePath := "https://XXX/open_platform/openapi"
httpCLient := http.Client{Timeout: 1 * time.Second}
Config := cdpCli.Configuration{AccessKeyId: testAk,
AccessKeySecret: testSk,
BasePath: basePath,
HTTPClient: &httpCLient}
client, err := cdpCli.NewAPIClient(&Config)
if err != nil {
fmt.Println("NewAPIClient err", err)
return
}
responseBody, httpRespose, err := client.SegmentationApi.LegacyGetSegment(context.Background(), 1, 1000302)
if err != nil {
fmt.Printf("getSegment query fail, err:%v, statusCod:%v", err, httpRespose.StatusCode)
} else {
fmt.Printf("getSegment success, body is:%v, data is:%v", responseBody, *responseBody.Data)
}
}
# Functions
CacheExpires helper function to determine remaining time before repeating a request.
No description provided by the author
NewAPIClient creates a new API client.
No description provided by the author
No description provided by the author
No description provided by the author
# Variables
ContextAccessToken takes a string oauth2 access token as authentication for the request.
ContextAPIKey takes an APIKey as authentication for the request.
ContextBasicAuth takes BasicAuth as authentication for the request.
ContextOAuth2 takes a oauth2.TokenSource as authentication for the request.
# Structs
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
APIClient manages communication with the CDP开放接口 API v2023-02-10 In most cases there should be only one, shared, APIClient.
APIKey provides API key based authentication to a request passed via context using ContextAPIKey.
No description provided by the author
No description provided by the author
BasicAuth provides basic http authentication to a request passed via context using ContextBasicAuth.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
GenericSwaggerError Provides access to the body, error and model on returned errors.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
标签树结点全部信息,部分字段在特定查询case下非null,返回值时为root层级结点List.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
# Type aliases
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author