byteplus-go-sdk-v2

module
v1.0.23 Latest Latest
Warning

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

Go to latest
Published: Aug 14, 2025 License: Apache-2.0

README

English | 简体中文

Byteplus SDK for Go

Overview

  • SDK for Go
  • Go =>1.14+; Go =>1.18+ if using the ModelArk service (service/arkruntime)
  • please don't modify any source code under path /service, which is fully machine generated
  • recommend using Go modules - built-in feature dependency versioning and dependency management
Sample:
package main

import (
	"fmt"

	"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"
	"github.com/byteplus-sdk/byteplus-go-sdk-v2/service/vpc"
)

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 = "ap-southeast-1"
	config = byteplus.NewConfig().
		WithCredentials(credentials.NewStaticCredentials(ak, sk, "")).
		WithRegion(region)

	sess, err = session.NewSession(config)
	if err != nil {
		panic(err)
	}

	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)
}

For more code examples, please refer to: SDK Integration Document

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
ark
Package arkiface provides an interface to enable mocking the ARK service client for testing your code.
Package arkiface provides an interface to enable mocking the ARK service client for testing your code.
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.
cr
Package criface provides an interface to enable mocking the CR service client for testing your code.
Package criface provides an interface to enable mocking the CR service client for testing your code.
ecs
Package ecsiface provides an interface to enable mocking the ECS service client for testing your code.
Package ecsiface provides an interface to enable mocking the ECS service client for testing your code.
iam
Package iamiface provides an interface to enable mocking the IAM service client for testing your code.
Package iamiface provides an interface to enable mocking the IAM service client for testing your code.
iam20210801
Package iam20210801iface provides an interface to enable mocking the IAM20210801 service client for testing your code.
Package iam20210801iface provides an interface to enable mocking the IAM20210801 service client for testing your code.
kms
Package kmsiface provides an interface to enable mocking the KMS service client for testing your code.
Package kmsiface provides an interface to enable mocking the KMS 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