Documentation ¶
Index ¶
- Constants
- func CompareSHA1(a, b []byte) bool
- func CompileRegex(v string, lineMatch bool) (*regexp.Regexp, error)
- func ComputeSHA1(file string) ([]byte, error)
- func DecodeJSONAuth(authBase64 string) string
- func HasDigest(tag string) bool
- func HasName(tag string) bool
- func IsDigest(d string) bool
- func JoinRefAndTag(ref, tag string) string
- func JoinRefsAndTag(srcRef, trgtRef, tag string) (src, trgt string)
- func JoinTag(name, digest string) string
- func SplitPlatform(p string) (os, arch, variant string)
- func SplitRef(ref string) (reg, repo, tag string)
- func SplitTag(tag string) (name, digest string)
- type Regex
Constants ¶
const DigestPrefix = "sha256:"
const FormatDigest = "%s@%s"
const FormatName = "%s:%s"
Variables ¶
This section is empty.
Functions ¶
func CompareSHA1 ¶
func ComputeSHA1 ¶
func DecodeJSONAuth ¶
func IsDigest ¶
IsDigest returns true if d is a digest string. For performance reasons, this currently only checks for the presence of the `sha256:` prefix, and does not run a regex against d for full compliance check. This way, incorrect digests lead to errors, but correct digests do not incur a computational overhead.
func JoinRefAndTag ¶
JoinRefAndTag joins ref with tag, inserting the correct separator ':' or '@', depending on whether tag contains a name part or is purely a digest.
func JoinRefsAndTag ¶
JoinRefsAndTag joins the source and target ref for a sync action each with tag, according to these rules:
- If tag contains a digest, srcRef is joined with only the digest as tag, and trgtRef with either only the name part of tag (if present), or the digest.
- Otherwise, srcRef and trgtRef are joined with tag.
This ensures that if a digest is present, we always use that when pulling an image, but still use the name if present when pushing.