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 GitTransformURL(targetBaseURL string, sourceURL string, pushUser string) (*url.URL, error)
- func GitTransformURLSplitRef(sourceURL string) (string, string, error)
- func GitTransformURLtoFolderName(sourceURL string) (string, error)
- func GitTransformURLtoRepoName(sourceURL string) (string, error)
- func ImageTransformHost(targetHost, srcReference string) (string, error)
- func ImageTransformHostWithoutChecksum(targetHost, srcReference string) (string, error)
- func MutateGitURLsInText(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
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 GitTransformURL ¶
GitTransformURL takes a base URL, a source url and a username and returns a Zarf-compatible url.
func GitTransformURLSplitRef ¶
GitTransformURLSplitRef takes a git url and returns a separated source url and zarf reference.
func GitTransformURLtoFolderName ¶
GitTransformURLtoFolderName takes a git url and returns the folder name for the repo in the Zarf package.
func GitTransformURLtoRepoName ¶
GitTransformURLtoRepoName 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.