Skip to content

Latest commit

 

History

261 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

rootly-go

Go types and API client for Rootly incident management platform, auto-generated from OpenAPI specifications.

Installation

go get github.com/rootlyhq/rootly-go

Usage

package 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)
}

Development

Prerequisites

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 for development guidelines.

About

A golang library for the Rootly API

Topics

Resources

Contributing

Stars

3 stars

Watchers

6 watching

Forks

Releases

Used by

Contributors

Languages