Documentation
¶
Index ¶
- func ComposePkgObjName(repoName, path, packageName string) string
- func ComposePkgRevObjName(repoName, path, packageName, workspace string) string
- func GetPRWorkspaceName(k8sName string) string
- func Revision2Int(revisionStr string) int
- func Revision2Str(revision int) string
- func SplitIn3OnDelimiter(splitee, delimiter string) []string
- func ValidPkgObjName(repoName, path, packageName string) error
- func ValidPkgRevObjName(repoName, path, packageName, workspace string) error
- func ValidateDirectoryName(directory string, mandatory bool) error
- func ValidateK8SName(k8sName string) error
- func ValidateRepository(repoName, directory string) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ComposePkgObjName ¶
ComposePkgObjName builds a Package object name, repo.path.package, with '/' in path replaced by '.'. It returns "" when repoName or packageName is empty.
func ComposePkgRevObjName ¶
ComposePkgRevObjName builds a PackageRevision object name, repo.path.package.workspace. It returns "" when repoName, packageName, or workspace is empty. The revision number is not included.
func GetPRWorkspaceName ¶
GetPRWorkspaceName returns the workspace suffix of a PackageRevision object name. A trailing semver (".v1.2.3") is kept intact, including its dots; otherwise the suffix is the segment after the last dot. It returns "" when k8sName has no '.'.
func Revision2Int ¶
Revision2Int parses a revision such as "3" or "v3". It returns -1 when the value is not an integer; -1 is the main revision.
func Revision2Str ¶
Revision2Str formats a revision number without a "v" prefix.
func SplitIn3OnDelimiter ¶
SplitIn3OnDelimiter splits splitee into exactly three parts: head, middle, and tail. One segment yields [s, "", ""]; two yield [first, "", last]. Further segments are rejoined into middle, so a dotted package path stays in the middle.
func ValidPkgObjName ¶
ValidPkgObjName checks that the composed Package object name is a DNS-1123 subdomain.
func ValidPkgRevObjName ¶
ValidPkgRevObjName checks that workspace is a DNS-1123 label and that the composed PackageRevision object name is a DNS-1123 subdomain.
func ValidateDirectoryName ¶
ValidateDirectoryName checks that directory is an RFC 1123 DNS label with '/' allowed as a separator. When mandatory is false, an empty directory (including "/") is valid.
func ValidateK8SName ¶
ValidateK8SName checks that k8sName is an RFC 1123 DNS label.
func ValidateRepository ¶
ValidateRepository checks that repoName is an RFC 1123 DNS label and that directory is a valid repository directory. An empty directory is allowed.
Types ¶
This section is empty.