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/
The following excellent projects are built upon this project to enrich the CNB ecosystem: