harbor

package
v0.3.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 3, 2020 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Artifact

type Artifact struct {
	ID                int64                  `json:"id"`
	Type              string                 `json:"type"`                // image, chart, etc
	MediaType         string                 `json:"media_type"`          // the media type of artifact. Mostly, it's the value of `manifest.config.mediatype`
	ManifestMediaType string                 `json:"manifest_media_type"` // the media type of manifest/index
	ProjectID         int64                  `json:"project_id"`
	RepositoryID      int64                  `json:"repository_id"`
	RepositoryName    string                 `json:"repository_name"`
	Digest            string                 `json:"digest"`
	Size              int64                  `json:"size"`
	Icon              string                 `json:"icon"`
	PushTime          time.Time              `json:"push_time"`
	PullTime          time.Time              `json:"pull_time"`
	ExtraAttrs        map[string]interface{} `json:"extra_attrs"` // only contains the simple attributes specific for the different artifact type, most of them should come from the config layer
	Annotations       map[string]string      `json:"annotations"`
	Tags              []*Tag                 `json:"tags"` // the list of tags that attached to the artifact
}

Artifact is copy from https://github.com/goharbor/harbor/blob/master/src/pkg/artifact/model.go#L31-L47 can not reference `Artifact` struct directly, since it cant not find https://github.com/goharbor/harbor/blob/master/src/pkg/artifact/model.go#L24 package.

type ProxyClient

type ProxyClient interface {
	ServeHTTP(w http.ResponseWriter, r *http.Request)

	ListArtifacts(project, repo string) ([]Artifact, error)
	// contains filtered or unexported methods
}

ProxyClient is the proxy client to Harbor core service.

func NewFakeProxy

func NewFakeProxy() ProxyClient

func NewProxy

func NewProxy(domain, username, password string) ProxyClient

type Tag

type Tag struct {
	ID           int64     `json:"id"`
	RepositoryID int64     `json:"repository_id"` // tags are the resources of repository, one repository only contains one same name tag
	ArtifactID   int64     `json:"artifact_id"`   // the artifact ID that the tag attaches to, it changes when pushing a same name but different digest artifact
	Name         string    `json:"name"`
	PushTime     time.Time `json:"push_time"`
	PullTime     time.Time `json:"pull_time"`
}

Tag is copy from https://github.com/goharbor/harbor/blob/master/src/pkg/tag/model/tag/model.go

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL