ByCloud Docs
GuidesCLIAPISDK

Go SDK

Official Go SDK with context support

Installation

go get github.com/bycoded/bycloud-go

Quick Start

Here's a quick example to get you started with the Go SDK:

package main
import (
"context"
"fmt"
"github.com/bycoded/bycloud-go"
)
func main() {
// Initialize the client
client := bycloud.New(bycloud.WithToken("YOUR_ACCESS_TOKEN"))
ctx := context.Background()
// List all instances
instances, err := client.Compute.ListInstances(ctx)
if err != nil {
panic(err)
}
fmt.Println(instances)
// Create a new instance
newInstance, err := client.Compute.CreateInstance(ctx, &bycloud.CreateInstanceParams{
Name: "my-instance",
FlavorID: "c1.medium",
ImageID: "ubuntu-22.04",
})
if err != nil {
panic(err)
}
fmt.Println(newInstance)
}

Features

- Full coverage of the ByCloud API

- Automatic request signing and authentication

- Built-in error handling and retries

- Strongly typed responses