Skip to content

A harbor api sdk。直接可以进行harbor调用,方便好用,开箱即用那种。

License

Notifications You must be signed in to change notification settings

XuHaoIgeneral/goharbor

Repository files navigation

goharbor

v 1.0.6

package main

import (
	"context"
	"fmt"
	"github.com/XuHaoIgeneral/goharbor"
)

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

About

A harbor api sdk。直接可以进行harbor调用,方便好用,开箱即用那种。

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages