go-client

module
v0.29.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 24, 2023 License: Apache-2.0

README

go-client

Client library with golang for accessing Harbor API.

Download swagger spec by version

Currently, the default Harbor version is v2.9.0.

NOTE Default version need to be updated manually inside Makefile

To download swagger spec:

make update-spec

To download swagger spec from previous Harbor version, add VERSION as an argument:

make update-spec VERSION=v2.9.0

Generate Clients

make gen-harbor-api VERSION=v2.9.0

Check all available make commands

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:

c := Config{
	URL: url,
	Transport: tr,
	AuthInfo: ai,
}

cs := NewClientSet(c)

cs.V2() // v2 client

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL