An open API service indexing awesome lists of open source software.

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

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)
}
}

```