Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/goharbor/go-client
Client library with golang for accessing Harbor API.
https://github.com/goharbor/go-client
Last synced: 3 months ago
JSON representation
Client library with golang for accessing Harbor API.
- Host: GitHub
- URL: https://github.com/goharbor/go-client
- Owner: goharbor
- License: apache-2.0
- Created: 2021-11-17T03:17:20.000Z (almost 3 years ago)
- Default Branch: main
- Last Pushed: 2024-03-09T10:58:19.000Z (8 months ago)
- Last Synced: 2024-06-27T05:21:26.270Z (5 months ago)
- Language: Go
- Size: 1020 KB
- Stars: 36
- Watchers: 9
- Forks: 17
- Open Issues: 9
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# go-client
Client library with golang for accessing Harbor API.## Download swagger spec by version
Currently, the default Harbor version is `v2.10.0`.
*NOTE* Default version need to be updated manually inside [Makefile](Makefile)
To download swagger spec:
```sh
make update-spec
```To download swagger spec from previous Harbor version, add `VERSION` as an argument:
```sh
make update-spec VERSION=v2.10.0
```## Generate Clients
```sh
make gen-harbor-api VERSION=v2.10.0
```## Check all available make commands
```sh
make
```## To use the Clients
There is `ClientSet` defined inside `pkg/harbor/client.go` to construct Clients
Create a `Config` first then use it to create `ClientSet`
For Example:
```go
c := Config{
URL: url,
Transport: tr,
AuthInfo: ai,
}cs := NewClientSet(c)
cs.V2() // v2 client
```