Go
The Go client uses gRPC. Dial the apiserver, then call a generated service
through platformsdk.Client.
cl, err := platformsdk.Dial("127.0.0.1:9090", platformsdk.WithInsecure(), platformsdk.WithToken(os.Getenv("PLATFORM_TOKEN")), platformsdk.WithApp("app_default"),)ctx := cl.Context(context.Background())resp, err := cl.Compute.ListInstances(ctx, &genv1.ListInstancesRequest{})cl.Catalog.ListInstanceTypes is the same pattern against the catalog.
A full create / wait / stop / delete walkthrough lives in this repo:
go run ./sdk/go/examples/lifecycleThat example reads PLATFORM_GRPC (default 127.0.0.1:9091 for the docker
provider), PLATFORM_TOKEN, and PLATFORM_APP. Against a local apiserver
use PLATFORM_GRPC=127.0.0.1:9090.
Install
Section titled “Install”Needs Go 1.25+.
go get github.com/cloud/platform/sdk/goRun that from the directory that contains your go.mod. Apple Silicon and
Intel both work.
Needs Go 1.25+.
go get github.com/cloud/platform/sdk/goRun that from the directory that contains your go.mod.
Install Go 1.25+. In PowerShell, from the directory that
contains your go.mod:
go get github.com/cloud/platform/sdk/goImports:
import ( platformsdk "github.com/cloud/platform/sdk/go" genv1 "github.com/cloud/platform/sdk/go/genv1")