utils

package
v1.2.3 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: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckIfIncludeTag

func CheckIfIncludeTag(repository string) bool

CheckIfIncludeTag checks if a repository string includes tag

func IsContain

func IsContain(items []string, item string) bool

IsContain judge the item is in items or not

func IsDigestNotFound added in v1.2.1

func IsDigestNotFound(err error) bool

IsDigestNotFound judge is the digest exist

func IsTagsNotFound added in v1.2.0

func IsTagsNotFound(err error) bool

IsTagsNotFound judge is the error get tags from repo http not found

func NewLimiter

func NewLimiter(rate int) ratelimit.Limiter

NewLimiter generates a new limiter.

func NewListLimiter

func NewListLimiter(rate int) ratelimit.Limiter

NewListLimiter generates a new limiter.

func NewListRateLimitedTransport

func NewListRateLimitedTransport(rate int, transport http.RoundTripper) http.RoundTripper

NewListRateLimitedTransport generates a new transport with rateLimit.

func NewRateLimitedTransport

func NewRateLimitedTransport(rate int, transport http.RoundTripper) http.RoundTripper

NewRateLimitedTransport generates a new transport with rateLimit.

Types

type RepoURL

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

The RepoURL will divide a images url to <registry>/<namespace>/<repo>:<tag>

func NewRepoURL

func NewRepoURL(url string) (*RepoURL, error)

NewRepoURL creates a RepoURL

func (*RepoURL) GetNamespace

func (r *RepoURL) GetNamespace() string

GetNamespace returns the namespace in a url

func (*RepoURL) GetOriginURL

func (r *RepoURL) GetOriginURL() string

GetOriginURL returns the whole url

func (*RepoURL) GetRegistry

func (r *RepoURL) GetRegistry() string

GetRegistry returns the registry in a url

func (*RepoURL) GetRepo

func (r *RepoURL) GetRepo() string

GetRepo returns the repository in a url

func (*RepoURL) GetRepoWithNamespace

func (r *RepoURL) GetRepoWithNamespace() string

GetRepoWithNamespace returns namespace/repository in a url

func (*RepoURL) GetRepoWithTag

func (r *RepoURL) GetRepoWithTag() string

GetRepoWithTag returns repository:tag in a url

func (*RepoURL) GetTag

func (r *RepoURL) GetTag() string

GetTag returns the tag in a url

func (*RepoURL) GetURL

func (r *RepoURL) GetURL() string

GetURL returns the whole url

func (*RepoURL) GetURLWithoutTag

func (r *RepoURL) GetURLWithoutTag() string

GetURLWithoutTag returns registry/namespace/repository in a url

Jump to

Keyboard shortcuts

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