utils

package
v1.5.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	DockerHubURL = "docker.io"
)
View Source
const Oauth2User = "_oauth2_"

Variables

This section is empty.

Functions

func AttachConnectorToTagOrDigest added in v1.5.0

func AttachConnectorToTagOrDigest(tagOrDigest string) string

func Black added in v1.5.0

func Black(str string, modifier ...interface{}) string

func Blue added in v1.5.0

func Blue(str string, modifier ...interface{}) string

func Brown added in v1.5.0

func Brown(str string, modifier ...interface{}) string

func Cyan added in v1.5.0

func Cyan(str string, modifier ...interface{}) string

func DarkGray added in v1.5.0

func DarkGray(str string, modifier ...interface{}) string

func GCPTokenFromCreds

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

GCPTokenFromCreds creates oauth2 token from permanent service account token

func Green added in v1.5.0

func Green(str string, modifier ...interface{}) string

func IsGCRPermanentServiceAccountToken

func IsGCRPermanentServiceAccountToken(registry string, username string) bool

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

func LightBlue added in v1.5.0

func LightBlue(str string, modifier ...interface{}) string

func LightCyan added in v1.5.0

func LightCyan(str string, modifier ...interface{}) string

func LightGray added in v1.5.0

func LightGray(str string, modifier ...interface{}) string

func LightGreen added in v1.5.0

func LightGreen(str string, modifier ...interface{}) string

func LightPurple added in v1.5.0

func LightPurple(str string, modifier ...interface{}) string

func LightRed added in v1.5.0

func LightRed(str string, modifier ...interface{}) string

func Purple added in v1.5.0

func Purple(str string, modifier ...interface{}) string

func Red added in v1.5.0

func Red(str string, modifier ...interface{}) string

func RemoveEmptyItems added in v1.4.1

func RemoveEmptyItems(slice []string) []string

func RepoMathPrefix added in v1.5.0

func RepoMathPrefix(repo, prefix string) bool

func White added in v1.5.0

func White(str string, modifier ...interface{}) string

func Yellow added in v1.5.0

func Yellow(str string, modifier ...interface{}) string

Types

type Auth added in v1.5.0

type Auth struct {
	Username string `json:"username" yaml:"username"`
	Password string `json:"password" yaml:"password"`
	Insecure bool   `json:"insecure" yaml:"insecure"`
}

Auth describes the authentication information of a registry or a repository

type CTXKey

type CTXKey string

type RepoURL

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

func GenerateRepoURLs added in v1.5.0

func GenerateRepoURLs(url string, externalTagsOrDigest func(registry, repository string,
) (tagsOrDigest []string, err error)) ([]*RepoURL, error)

GenerateRepoURLs creates a RepoURL slice. If url has no tags or digest, tags or digest should be provided by externalTagsOrDigest func, and empty slice will be returned if no tags or digest is provided.

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) GetRepoWithTagOrDigest added in v1.5.0

func (r *RepoURL) GetRepoWithTagOrDigest() string

GetRepoWithTagOrDigest returns repository:tag in a url

func (*RepoURL) GetTagOrDigest added in v1.5.0

func (r *RepoURL) GetTagOrDigest() string

GetTagOrDigest returns the tag in a url

func (*RepoURL) GetURLWithoutTagOrDigest added in v1.5.0

func (r *RepoURL) GetURLWithoutTagOrDigest() string

func (*RepoURL) HasDigest added in v1.5.0

func (r *RepoURL) HasDigest() bool

func (*RepoURL) String added in v1.5.0

func (r *RepoURL) String() string

GetURL returns the whole url

Jump to

Keyboard shortcuts

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