https://github.com/nevercase/harbor-api
This is a simple and easy way for you to interact with Harbor.
https://github.com/nevercase/harbor-api
harbor harbor-api harbor-watch
Last synced: about 1 year ago
JSON representation
This is a simple and easy way for you to interact with Harbor.
- Host: GitHub
- URL: https://github.com/nevercase/harbor-api
- Owner: neverCase
- Created: 2020-07-08T08:52:52.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2021-06-24T09:42:46.000Z (about 5 years ago)
- Last Synced: 2025-02-01T14:46:25.085Z (over 1 year ago)
- Topics: harbor, harbor-api, harbor-watch
- Language: Go
- Homepage:
- Size: 112 KB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# harbor-api
This is a simple and easy way for you to interact with Harbor.
### notice
* The structures inside the harbor.go were all imported from [goharbor/harbor](https://github.com/goharbor/harbor/tree/master/src)
## Features
* Projects() (res []models.Project, err error)
* Repositories(projectName string) (res []models.RepoRecord, err error)
* Artifacts(projectName string, repositoryName string) (res []artifact.Artifact, err error)
* Tags(projectName string, repositoryName string) (res []*tag.Tag, err error)
* References(projectName string, repositoryName string, digestOrTag string) (res artifact.Artifact, err error)
* Watch(opt Option) (watch.Interface, error), watch implements the k8s.io/apimachinery/pkg/watch.Interface, and it watches and compares the image's sha256 by the specific tag
## Usage
```
h := NewHarbor(url, admin, password)
res, err := h.Projects()
...
```
## Todo
* add api pagination in the future