https://github.com/volcengine/volcengine-go-sdk
https://github.com/volcengine/volcengine-go-sdk
Last synced: 5 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/volcengine/volcengine-go-sdk
- Owner: volcengine
- License: apache-2.0
- Created: 2022-06-30T09:39:01.000Z (almost 4 years ago)
- Default Branch: master
- Last Pushed: 2026-01-23T06:52:29.000Z (5 months ago)
- Last Synced: 2026-01-24T00:23:03.274Z (5 months ago)
- Language: Go
- Size: 14.6 MB
- Stars: 121
- Watchers: 3
- Forks: 33
- Open Issues: 3
-
Metadata Files:
- Readme: README.EN.MD
- License: LICENSE.txt
- Notice: NOTICE.txt
Awesome Lists containing this project
README
English | [中文](README.MD)
### Volcengine SDK for Go
#### Overview
1. Volcengine Cloud Go SDK.
2. Minimum Go version: **1.14+**. If using Ark service (`service/arkruntime`), **1.18+** is required.
3. Files in the `service` directory are auto-generated; do not modify them.
4. It is recommended to use `go mod` for dependency management.
#### Endpoint Configuration
If you want to customize the SDK endpoint, use the following code:
```go
config = volcengine.NewConfig().
WithCredentials(credentials.NewStaticCredentials(ak, sk, "")).
WithRegion(region).WithEndpoint("ecs.cn-beijing-autodriving.volcengineapi.com")
```
Standard endpoint rules:
| Regional Service | Global Service |
|---|---|
| `{service}.{region}.volcengineapi.com`
Example: `ecs.cn-beijing-autodriving.volcengineapi.com` | `{service}.volcengineapi.com`
Example: `iam.volcengineapi.com` |
Note:
- If the service name contains `_`, it should be converted to `-` in the endpoint. Use lowercase for all characters.
#### Code Example
Examples are available in the `example` directory.
```go
package main
import (
"fmt"
"github.com/volcengine/volcengine-go-sdk/service/vpc"
"github.com/volcengine/volcengine-go-sdk/volcengine"
"github.com/volcengine/volcengine-go-sdk/volcengine/credentials"
"github.com/volcengine/volcengine-go-sdk/volcengine/session"
)
func main() {
var (
ak string
sk string
region string
config *volcengine.Config
sess *session.Session
client *vpc.VPC
resp *vpc.DescribeVpcsOutput
err error
)
ak = "your ak"
sk = "your sk"
region = "cn-beijing"
config = volcengine.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: volcengine.Int64(1),
PageSize: volcengine.Int64(10),
})
if err != nil {
panic(err)
}
fmt.Println(&resp)
}
```
For more examples, see: [SDK Integration Guide](./SDK_Integration.md)