https://github.com/bingbaba/harbor-go
Go client for the Harbor API
https://github.com/bingbaba/harbor-go
client golang harbor
Last synced: 5 months ago
JSON representation
Go client for the Harbor API
- Host: GitHub
- URL: https://github.com/bingbaba/harbor-go
- Owner: bingbaba
- Created: 2018-12-20T02:27:17.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2020-01-13T02:27:49.000Z (over 6 years ago)
- Last Synced: 2025-08-14T05:22:08.853Z (10 months ago)
- Topics: client, golang, harbor
- Language: Go
- Size: 8.79 KB
- Stars: 8
- Watchers: 1
- Forks: 4
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# harbor-go
```golang
package main
import (
"context"
"fmt"
"github.com/bingbaba/harbor-go"
)
const (
username = "admin"
password = "admin"
host = "http://myharbor.company.com"
)
func main() {
// create harbor client
c, err := harbor.NewClient(nil, host, username, password, true)
if err != nil {
panic(err)
}
// list project
ps, err := c.ListProjects(context.Background(), nil)
if err != nil {
panic(err)
}
// dump projects
for _, p := range ps {
fmt.Printf("%+v\n", p)
}
}
```