Go types and API client for Rootly incident management platform, auto-generated from OpenAPI specifications.
go get github.com/rootlyhq/rootly-gopackage main
import (
"context"
"fmt"
"github.com/rootlyhq/rootly-go"
)
func main() {
// Create a new client
client, err := rootly.NewClient("https://api.rootly.com", rootly.WithBearerToken("YOUR_API_TOKEN"))
if err != nil {
panic(err)
}
// List incidents
response, err := client.ListIncidents(context.Background(), &rootly.ListIncidentsParams{})
if err != nil {
panic(err)
}
defer response.Body.Close()
fmt.Println(response.Status)
}- Go 1.22.5 or later
- oapi-codegen v2
- Fetch latest API specification:
make fetch-spec - Generate Go code:
make gen - Complete workflow:
make fetch-spec gen
- Build:
make buildorgo build ./... - Test:
make testorgo test ./...
- Types: Comprehensive struct definitions for all Rootly API entities
- Client: HTTP client implementing all API operations
- Constants: Enum values and configuration constants
- Response handling: Structured response types with error handling
See CONTRIBUTING.md for development guidelines.