byteplus-go-sdk-v2

module
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Nov 21, 2024 License: Apache-2.0

README

Byteplus SDK for Go

概述

  1. Go语言SDK
  2. Go版本最低1.5+ 推荐是用1.12+
  3. service目录下的文件请不要修改,都是由代码生成器自动生成
  4. 建议使用go mod方式进行依赖管理
代码示例
package main

import (
"fmt"

"github.com/byteplus-sdk/byteplus-go-sdk-v2/service/vpc"
"github.com/byteplus-sdk/byteplus-go-sdk-v2/byteplus"
"github.com/byteplus-sdk/byteplus-go-sdk-v2/byteplus/credentials"
"github.com/byteplus-sdk/byteplus-go-sdk-v2/byteplus/session"
)

func main() {
 var (
  ak     string
  sk     string
  region string
  config *byteplus.Config
  sess   *session.Session
  client *vpc.VPC
  resp   *vpc.DescribeVpcsOutput
  err    error
 )
 ak = "your ak"
 sk = "your sk"
 region = "cn-beijing"
 config = byteplus.NewConfig().
         WithCredentials(credentials.NewStaticCredentials(ak, sk, "")).
         WithRegion(region)

 sess, _ = session.NewSession(config)
 client = vpc.New(sess)

 resp, err = client.DescribeVpcs(&vpc.DescribeVpcsInput{
	PageNumber: byteplus.Int64(1),
	PageSize:   byteplus.Int64(10),
 })

 if err != nil {
	panic(err)
 }

 fmt.Println(&resp)

 }

Directories

Path Synopsis
Package byteplus provides core functionality for making requests to byteplus services.
Package byteplus provides core functionality for making requests to byteplus services.
bytepluserr
Package bytepluserr represents API error interface accessors for the SDK.
Package bytepluserr represents API error interface accessors for the SDK.
credentials
Package credentials provides credential retrieval and management
Package credentials provides credential retrieval and management
defaults
Package defaults is a collection of helpers to retrieve the SDK's default configuration and handlers.
Package defaults is a collection of helpers to retrieve the SDK's default configuration and handlers.
internal
ini
private
protocol/json/jsonutil
Package jsonutil provides JSON serialization of BYTEPLUS requests and responses.
Package jsonutil provides JSON serialization of BYTEPLUS requests and responses.
protocol/query
Package query provides serialization of BYTEPLUS byteplusquery requests, and responses.
Package query provides serialization of BYTEPLUS byteplusquery requests, and responses.
protocol/rest
Package rest provides RESTFUL serialization of BYTEPLUS requests and responses.
Package rest provides RESTFUL serialization of BYTEPLUS requests and responses.
protocol/xml/xmlutil
Package xmlutil Package xml util provides XML serialization of BYTEPLUS requests and responses.
Package xmlutil Package xml util provides XML serialization of BYTEPLUS requests and responses.
service
billing
Package billingiface provides an interface to enable mocking the BILLING service client for testing your code.
Package billingiface provides an interface to enable mocking the BILLING service client for testing your code.
vpc
Package vpciface provides an interface to enable mocking the VPC service client for testing your code.
Package vpciface provides an interface to enable mocking the VPC service client for testing your code.

Jump to

Keyboard shortcuts

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