https://github.com/rootlyhq/rootly-go
A golang library for the Rootly API
https://github.com/rootlyhq/rootly-go
api client go http rootly
Last synced: about 16 hours ago
JSON representation
A golang library for the Rootly API
- Host: GitHub
- URL: https://github.com/rootlyhq/rootly-go
- Owner: rootlyhq
- License: mit
- Created: 2021-02-14T18:40:24.000Z (about 5 years ago)
- Default Branch: master
- Last Pushed: 2026-04-08T23:52:57.000Z (10 days ago)
- Last Synced: 2026-04-09T01:23:29.257Z (10 days ago)
- Topics: api, client, go, http, rootly
- Language: Go
- Homepage: https://rootly.com
- Size: 6.27 MB
- Stars: 2
- Watchers: 6
- Forks: 1
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Contributing: CONTRIBUTING.md
Awesome Lists containing this project
README
# rootly-go
Go types and API client for Rootly incident management platform, auto-generated from OpenAPI specifications.
## Installation
```bash
go get github.com/rootlyhq/rootly-go
```
## Usage
```go
package main
import (
"context"
"fmt"
"net/http"
"github.com/rootlyhq/rootly-go"
)
func main() {
// Create a new client
client, err := rootly.NewClient("https://api.rootly.com", rootly.WithRequestEditorFn(
func(ctx context.Context, req *http.Request) error {
req.Header.Set("Authorization", "Bearer YOUR_API_TOKEN")
return nil
},
))
if err != nil {
panic(err)
}
// Use the client to make API calls
ctx := context.Background()
// Example: List incidents
// response, err := client.GetIncidents(ctx, &rootly.GetIncidentsParams{})
}
```
## Development
### Prerequisites
- Go 1.22.5 or later
- [oapi-codegen](https://github.com/oapi-codegen/oapi-codegen) v2
### Generating the Code
1. **Fetch latest API specification**: `make fetch-spec`
2. **Generate Go code**: `make gen`
3. **Complete workflow**: `make fetch-spec gen`
### Building and Testing
- **Build**: `make build` or `go build ./...`
- **Test**: `make test` or `go test ./...`
## Generated Code Structure
- **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
## Contributing
See [CONTRIBUTING.md](CONTRIBUTING.md) for development guidelines.