The Genesis Cloud Go client provides the ability to manage each services resources programmatically from scripts or applications.
This repository is licensed under Mozilla Public License 2.0 (no copyleft exception) (see LICENSE.txt).
This client is maintained by Genesis Cloud. If you encounter any problems, feel free to create issues or pull requests.
- Go >= 1.19
go get github.com/genesiscloud/genesiscloud-go
import "github.com/genesiscloud/genesiscloud-go"
// Generic pointer in Go 1.18+. Alternatively use "k8s.io/utils/pointer"
func pointer[T any](v T) *T {
return &v
}
client, err := genesiscloud.NewGenesisCloudClient(genesiscloud.ClientConfig{
Token: os.Getenv("GENESISCLOUD_TOKEN"),
})
if err != nil {
// ...
}
resp, err := client.ListInstancesWithResponse(ctx, &genesiscloud.ListInstancesParams{
Page: pointer(1),
PerPage: pointer(100),
})
if err != nil {
// ...
}
You can find additional examples in the GoDoc or check the examples folder.
GENESISCLOUD_TOKEN="XXXX" go run ./examples/list-instances
# Update openapi.yaml (./codegen/openapi.yaml)
# Generate code
go generate ./...