repository

package
v0.0.0-...-4181570 Latest Latest
Warning

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

Go to latest
Published: Sep 15, 2021 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ArtifactSlice

type ArtifactSlice []harborapi.Artifact

根据 PushTime 对 Artifact 排序

func (ArtifactSlice) Latest

func (t ArtifactSlice) Latest() harborapi.Artifact

func (ArtifactSlice) Len

func (t ArtifactSlice) Len() int

func (ArtifactSlice) Less

func (t ArtifactSlice) Less(i, j int) bool

func (ArtifactSlice) Sort

func (t ArtifactSlice) Sort() ArtifactSlice

func (ArtifactSlice) Swap

func (t ArtifactSlice) Swap(i, j int)

type NotFoundRepoError

type NotFoundRepoError struct {
	// contains filtered or unexported fields
}

NotFoundRepoError 未找到对应的 repo

func (NotFoundRepoError) Error

func (e NotFoundRepoError) Error() string

type NotSupportRegisterError

type NotSupportRegisterError struct {
	// contains filtered or unexported fields
}

NotSupportRegisterError 不支持的注册中心地址

func (NotSupportRegisterError) Error

func (e NotSupportRegisterError) Error() string

type RepositoryService

type RepositoryService interface {
	// 获取镜像最新的 tag
	LatestTag(host, projectName, repoName string) (tag string, err error)
}

RepositoryService 镜像服务

func NewRepositoryService

func NewRepositoryService(options *RepositoryServiceOptions) (RepositoryService, error)

TODO support more repository NewRepositoryService

type RepositoryServiceOptions

type RepositoryServiceOptions struct {
	Mock     bool              `json:"mock,omitempty" yaml:"mock,omitempty"`
	MockTags map[string]string `json:"mockTags,omitempty" yaml:"mockTags,omitempty"`
	// repository address
	Host               string `json:"host" yaml:"host"`
	Protocol           string `json:"protocol" yaml:"protocol"`
	InsecureSkipVerify bool   `json:"insecureSkipVerify" yaml:"insecureSkipVerify"`
	ApiPathPrefix      string `json:"apiPathPrefix" yaml:"apiPathPrefix"`
}

func NewRepositoryServiceOptions

func NewRepositoryServiceOptions() *RepositoryServiceOptions

func (*RepositoryServiceOptions) AddFlags

func (r *RepositoryServiceOptions) AddFlags(fs *pflag.FlagSet)

func (*RepositoryServiceOptions) Validate

func (r *RepositoryServiceOptions) Validate() (errs []error)

type TagSlice

type TagSlice []harborapi.Tag

根据 PushTime 对 Tag 排序

func (TagSlice) Latest

func (t TagSlice) Latest() harborapi.Tag

func (TagSlice) Len

func (t TagSlice) Len() int

func (TagSlice) Less

func (t TagSlice) Less(i, j int) bool

func (TagSlice) Sort

func (t TagSlice) Sort() TagSlice

func (TagSlice) Swap

func (t TagSlice) Swap(i, j int)

Jump to

Keyboard shortcuts

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