Skip to content

LiveOakLabs/readme-api-go-client

Repository files navigation

Go Client for the ReadMe.com API

Version GoDoc

This is a Go client library for the ReadMe.com API.

Live Oak Bank

This package is developed by Live Oak Bank and is not affiliated with ReadMe.com.

Getting Started

Import the package and call the readme.NewClient() function with a token provided to set up the API client.

package main

import "github.com/liveoaklabs/readme-api-go-client/readme"

const readmeAPIKey string = "rdme_xxxxxxxx..."

func main() {
  client, err := readme.NewClient(readmeAPIKey)
  if err != nil {
    log.Fatal(err)
  }
}

Examples

Using the APISpecification.GetAll() method to retrieve all API specifications for a project on ReadMe.com:

specs, _, err := client.APISpecifications.GetAll()
if err != nil {
    log.Fatal("Error getting API specifications: ", err)
}

if specs == nil {
    log.Fatal("No results.")
}

Reference

Refer to https://pkg.go.dev/github.com/liveoaklabs/readme-api-go-client for the Go package documentation.

Contributing

Refer to CONTRIBUTING.md for information on contributing to this project.

Related

The Terraform provider for ReadMe uses this client library.

License

This project is licensed under the MIT License - see the LICENSE file for details.