logo
0
0
Login
Forkfromcnb-vip/go-cnb, ahead:master1 commits

License: MIT

go-cnb is a Go client library for accessing the CNB API.

This SDK is generated by cnb-sdk-generator

Installation

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

Usage

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 as https://api.cnb.cool/

How to contribute

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 make to generate the latest code. Then run make t to perform necessary tests. If the tests pass, submit a PR.

Projects

The following excellent projects are built upon this project to enrich the CNB ecosystem:

About

go-cnb 是一个 Go client library 用于访问 CNB API。

4.20 MiB
0 forks0 stars1 branches12 TagREADMEMIT license
Language
Go85.2%
Dockerfile12.6%
Makefile2.1%
Others0.1%