modulepackage
0.0.0-20200420134129-b5620c3d2138
Repository: https://github.com/elenz97/go-harbor.git
Documentation: pkg.go.dev
# README
go-harbor
A Harbor API client enabling Go programs to perform CRUD operations on goharbor users and projects
This library is mainly build upon goharbor/v1.10.1
Usage
Initialize a new go-harbor client, then use the various services on the client to access different parts of the Harbor API.
package main
import (
"errors"
"fmt"
"github.com/elenz97/go-harbor"
)
func main() {
client, err := harbor.NewClient("url", "username", "password")
if err != nil {
panic(err)
}
// Projects
projects, err := client.Projects().ListProjects(harbor.ListProjectOptions{})
if err != nil {
var e *harbor.StatusCodeError
if errors.As(err, &e) {
// handle status code error
fmt.Printf("request failed with status code: %d", e.StatusCode)
} else {
panic(err)
}
}
for _, p := range projects {
fmt.Println(p.Name)
}
// Users
users, err := client.Users().ListUsers()
// ...
}
Documentation
For more specific documentation, please refer to the godoc of this library
# Functions
CheckResponse flattens errors and checks the response status code.
No description provided by the author
No description provided by the author
# Structs
AccessLog holds the information of log entries.
ChangePassword holds the information needed to change a users password.
ChangePasswordAsAdmin holds the information needed to change a users password as administrator.
No description provided by the author
ComponentsOverview holds information about the total number of components with a certain CVE severity.
ComponentsOverviewEntry ...
CVEWhitelist holds project specific information next to the set CVEWhitelistItem's.
CVEWhitelistItem holds the CVE ids of a whitelisted item.
ImgScanOverview maps the record of an image scan overview.
LogQueryParam is used to set query conditions when listing access logs.
ListOptions specifies the optional parameters to various List methods that support pagination.
ListProjectsOptions holds the information needed to list a project.
No description provided by the author
No description provided by the author
MemberRequest holds the information needed to update a project member.
MemberUser holds the user information needed for a project member request.
Project holds the details of a project.
ProjectClient handles communication with the project related methods of the Harbor API.
ProjectMemberRequest holds the information needed to add a project member.
ProjectMetadata holds the metadata of a project.
ProjectRequest holds the information needed to create a project.
RepoRecord holds the record of an repository, held by the database.
No description provided by the author
RepositoryClient handles communication with the repository related methods of the Harbor API.
No description provided by the author
Role holds the details of a role.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
User holds the details of a user.
UserClient handles communication with the user related methods of the Harbor API.
UserRequest holds the information needed for basic operations on users.
UserSearchResult holds the information returned by the API when querying for a user name.
VulnerabilityItem is an item in the vulnerability result returned by the vulnerability details API.
# Type aliases
No description provided by the author