Documentation ¶
Overview ¶
Package transform provides helper functions to transform URLs to airgap equivalents
Package transform provides helper functions to transform URLs to airgap equivalents ¶
Package transform provides helper functions to transform URLs to airgap equivalents
Index ¶
- Constants
- func GenTransformURL(targetBaseURL string, sourceURL string) (*url.URL, error)
- func GitURL(targetBaseURL string, sourceURL string, pushUser string) (*url.URL, error)
- func GitURLSplitRef(sourceURL string) (string, string, error)
- func GitURLtoFolderName(sourceURL string) (string, error)
- func GitURLtoRepoName(sourceURL string) (string, error)
- func ImageTransformHost(targetHost, srcReference string) (string, error)
- func ImageTransformHostWithoutChecksum(targetHost, srcReference string) (string, error)
- func MutateGitURLsInText(logger Log, targetBaseURL string, text string, pushUser string) string
- func NoTransformTarget(address string, path string) (*url.URL, error)
- func NpmTransformURL(targetBaseURL string, sourceURL string) (*url.URL, error)
- func PipTransformURL(targetBaseURL string, sourceURL string) (*url.URL, error)
- type Image
- type Log
Constants ¶
const (
// NoTransform is the URL prefix added to HTTP 3xx or text URLs that instructs Zarf not to transform on a subsequent request.
NoTransform = "/zarf-3xx-no-transform"
)
Variables ¶
This section is empty.
Functions ¶
func GenTransformURL ¶
GenTransformURL finds the generic API path on a given URL and transforms that to align with the offline registry.
func GitURL ¶ added in v0.28.3
GitURL takes a base URL, a source url and a username and returns a Zarf-compatible url.
func GitURLSplitRef ¶ added in v0.28.3
GitURLSplitRef takes a git url and returns a separated source url and zarf reference.
func GitURLtoFolderName ¶ added in v0.28.3
GitURLtoFolderName takes a git url and returns the folder name for the repo in the Zarf package.
func GitURLtoRepoName ¶ added in v0.28.3
GitURLtoRepoName takes a git url and returns the name of the repo in the remote airgap repository.
func ImageTransformHost ¶
ImageTransformHost replaces the base url for an image and adds a crc32 of the original url to the end of the src (note image refs are not full URLs).
func ImageTransformHostWithoutChecksum ¶
ImageTransformHostWithoutChecksum replaces the base url for an image but avoids adding a checksum of the original url (note image refs are not full URLs).
func MutateGitURLsInText ¶
MutateGitURLsInText changes the gitURL hostname to use the repository Zarf is configured to use.
func NoTransformTarget ¶
NoTransformTarget takes an address that Zarf should not transform, and removes the NoTransform prefix.
func NpmTransformURL ¶
NpmTransformURL finds the npm API path on a given URL and transforms that to align with the offline registry.