utils

package
v1.4.1 Latest Latest
Warning

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

Go to latest
Published: Jul 5, 2023 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const Oauth2User = "_oauth2_"

Variables

This section is empty.

Functions

func CheckIfIncludeTag

func CheckIfIncludeTag(repository string) bool

CheckIfIncludeTag checks if a repository string includes tag

func GCPTokenFromCreds

func GCPTokenFromCreds(creds string) (string, time.Time, error)

GCPTokenFromCreds creates oauth2 token from permanent service account token

func IsGCRPermanentServiceAccountToken

func IsGCRPermanentServiceAccountToken(registry string, username string) bool

IsGCRPermanentServiceAccountToken returns true if user is a Google permanent service account token

func RemoveEmptyItems added in v1.4.1

func RemoveEmptyItems(slice []string) []string

Types

type CTXKey

type CTXKey string

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