The SDK that powers the Nuon runner.
The Nuon runner is deployed in each install, and powers everything from updates, releases and rollouts to day 2 monitoring.
Full documentation is available at https://runner.nuon.co/docs/index.html.
All endpoints in the API follow REST conventions and standard HTTP methods. You can find the OpenAPI Spec here
In your project, you can install the package directly using go get
:
go get github.com/nuonco/nuon-runner-go
In your code, add the following import:
import nuonrunner "github.com/nuonco/nuon-runner-go"
Create a new api client, using an API key set in the environment.
apiURL := "https://runner.nuon.co"
apiToken := os.Getenv("NUON_API_TOKEN")
runnerID := os.Getenv("NUON_RUNNER_ID")
apiClient, err := client.New(s.v,
client.WithAuthToken(apiToken),
client.WithURL(apiURL),
client.WithRunnerID(orgID),
)
if err != nil {
return fmt.Errorf("unable to get api client: %w", err)
}
jobs, err := apiClient.AvailableJobs(ctx)
Please submit a PR, and if you would like help, contact us on our community slack.
You can generate mock code using:
$ go generate ./...
You can also change the open api spec to generate against, by setting the API_URL
field to a different value:
$ NUON_API_URL=http://localhost:8081 go generate ./...