omnistrate-sdk-go is an auto-generated Go API client for interacting with Omnistrate APIs. It is generated using the OpenAPI Generator from Omnistrate's OpenAPI specifications.
The SDK is split into two packages, each targeting a different set of Omnistrate APIs:
| Package | Import Path | Description |
|---|---|---|
| v1 | github.com/omnistrate-oss/omnistrate-sdk-go/v1 |
Service Registration, Build, and Consumption APIs |
| fleet | github.com/omnistrate-oss/omnistrate-sdk-go/fleet |
Fleet management APIs (host clusters, operations, inventory, webhooks, etc.) |
Each package has its own detailed documentation with a full list of API endpoints and models.
go get github.com/omnistrate-oss/omnistrate-sdk-go@latestpackage main
import (
"context"
"fmt"
v1 "github.com/omnistrate-oss/omnistrate-sdk-go/v1"
)
func main() {
cfg := v1.NewConfiguration()
client := v1.NewAPIClient(cfg)
// Authenticate
ctx := context.WithValue(context.Background(), v1.ContextAccessToken, "your-token")
// Use the client
providers, _, err := client.CloudProviderApiAPI.CloudProviderApiListCloudProvider(ctx).Execute()
if err != nil {
panic(err)
}
fmt.Println(providers)
}The entire SDK is auto-generated from Omnistrate's OpenAPI specs. The generation pipeline is driven by the Makefile:
- OpenAPI specs are fetched from
https://api.omnistrate.cloud/2022-09-01-00/openapi.yaml(v1) and.../fleet/openapi.yaml(fleet). - openapi-generator produces Go client code into
v1/andfleet/using custom Mustache templates fromtemplates/go/. - The generated code includes typed API clients, request/response models, configuration, and documentation.
| Target | Description |
|---|---|
make all |
Clean, regenerate, tidy, and build |
make build |
Build the Go SDK |
make clean |
Remove generated v1/ and fleet/ directories |
make gen-go-sdk |
Generate the v1 API client |
make gen-fleet-go-sdk |
Generate the fleet API client |
make validate |
Validate OpenAPI specs |
make tidy |
Run go mod tidy |
make download |
Download Go module dependencies |
The build workflow runs on pushes and PRs to main:
- Checks out the code, sets up Go, downloads dependencies, and runs
make build. - On push to
main, automatically bumps the version tag and publishes a new release.
├── v1/ # Generated v1 API client (Service Registration & Consumption)
│ ├── api_*.go # API endpoint implementations
│ ├── model_*.go # Request/response model structs
│ ├── client.go # APIClient struct
│ ├── configuration.go # Configuration (server URL, auth, headers)
│ └── docs/ # Generated API & model documentation
├── fleet/ # Generated Fleet API client
│ ├── api_*.go # Fleet API endpoint implementations
│ ├── model_*.go # Fleet model structs
│ ├── client.go # Fleet APIClient struct
│ ├── configuration.go # Fleet configuration
│ └── docs/ # Generated Fleet documentation
├── templates/go/ # Custom Mustache templates for code generation
├── src/ # OpenAPI Generator meta scaffolding (unused)
├── Makefile # Build, generate, and validate targets
└── .github/workflows/ # CI/CD (build + auto-tag)
Want to contribute? Awesome! You can find information about contributing to this project in the CONTRIBUTING page.
Omnistrate is the operating system for your SaaS, offering enterprise-grade capabilities: automated provisioning, serverless capabilities, auto-scaling, billing, monitoring, centralized logging, self-healing, intelligent patching and much more!