手擼 golang 原生騰訊雲 SDK,大家給品品

程式設計師 Chrics • at 2021-02-22 14:15:03 • 5 Views

提供網路故障重試、頻率限制延時重試、自動注入 ClientToken 等功能,有不錯的擴充套件能力

上倉庫地址: https://github.com/vincenthcui/awesome-tencentcloud-go

package main

import (
	"context"
	cvm "github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/cvm/v20170312"
	tc "github.com/vincenthcui/awesome-tencentcloud-go/tencentcloud"
)

func main() {
	client := tc.NewClient(tc.WithSecret("SECRETID", "SECRETKEY"))

	req := cvm.NewDescribeInstancesRequest()
	resp := cvm.NewDescribeInstancesResponse()

	err := client.Send(context.TODO(), tc.CVMDescribeInstances, req, resp)
	if err != nil {
		panic(err)
    }
}
Total: 5
  • hotsymbol 2021-02-22 14:15:03
    南山紅帽子傳票準備
  • darksword21 2021-02-22 14:15:03
    其實騰訊雲官方的 sdk 用起來還好啦,經歷過華為的之後。。
  • Chrics 2021-02-22 14:15:03
    @hotsymbol 呼叫 API 不受版權影響吧
  • Chrics 2021-02-22 14:15:03
    @darksword21 完全滿足日常使用需求。如果要求更高的一致性,就需要在業務裡搞重試和頻限。
  • lairdnote 2021-02-22 14:15:03
    非法呼叫 API 南山紅帽子來了
Add a reply
For Commenting you need to Login. If you dont have a Account you need to Register.