Skip to content

A Harbor API client enabling Go programs to interact with Harbor in a simple and uniform way

License

Notifications You must be signed in to change notification settings

clarechu/go-harbor

 
 

Repository files navigation

go-harbor

A Harbor API client enabling Go programs to interact with Harbor in a simple and uniform way

GitHub license

Coverage

This API client package covers most of the existing Harbor API calls and is updated regularly to add new and/or missing endpoints. Currently the following services are supported:

  • Users
  • Projects
  • Repositories
  • Jobs
  • Policies
  • Targets
  • SystemInfo
  • LDAP
  • Configurations

Usage

import "github.com/TimeBye/go-harbor"

Construct a new Harbor client, then use the various services on the client to access different parts of the Harbor API. For example, to list all users:

harborClient := harbor.NewClient(nil, "url","username","password")
statisticMap, _, errs := harborClient.GetStatistics()

Some API methods have optional parameters that can be passed. For example, to list all projects for user "haobor":

harborClient := harbor.NewClient(nil, "url","username","password")
opt := &ListProjectsOptions{Name: "haobor"}
projects, _, err := harborClient.Projects.ListProjects(opt)

For complete usage of go-harbor, see the full package docs.

ToDo

  • The biggest thing this package still needs is tests 😞

Issues

About

A Harbor API client enabling Go programs to interact with Harbor in a simple and uniform way

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Go 100.0%