go-cnb is a Go client library for accessing the CNB API.
This SDK is generated by cnb-sdk-generator
go get cnb.cool/cnb/sdk/go-cnb # Get the latest tag version of go-cnb go get cnb.cool/cnb/sdk/go-cnb@v1.0.0 # Get a specific tag version of go-cnb go get cnb.cool/cnb/sdk/go-cnb@master # [Not recommended] Get the latest commit from master branch
import "cnb.cool/cnb/sdk/go-cnb/cnb"
Create a CNB Client, then use various services to access CNB APIs.
client, _ = cnb.NewClient(nil).WithAuthToken("...your cnb token...").WithURLs("...cnb base url...")
repo, rsp, err := client.Repositories.GetRepo(ctx, repoName)
For URLs requiring authentication, you can apply for a TOKEN with appropriate permissions in CNB's Personal Settings -> Access Tokens. The BaseURL rule is
api.prefix plus the main domain, such ashttps://api.cnb.cool/
If you want to contribute code, please submit a PR, and we will handle it as soon as possible. If you find any problems, please submit an Issue, and we will handle it as soon as possible.
Since this project is generated by cnb-sdk-generator, in most cases, you only need to run
maketo generate the latest code. Then runmake tto perform necessary tests. If the tests pass, submit a PR.
The following excellent projects are built upon this project to enrich the CNB ecosystem: