Documentation
¶
Overview ¶
Package provenance holds where GitOps files live: the Repository and the Location (repository, branch and directory), parsed from a repository URL or named by the caller. Each GitOps tool's resolver builds a Location from that tool's objects (target/flux for Flux). The package talks to no cluster.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ( // ErrNoBranch is returned for a location without a branch: a GitOps // source that follows a tag, semver range or commit cannot receive a // commit. ErrNoBranch = errors.New("git repository follows no branch") // ErrNotGitHub is returned for a repository URL that is not a GitHub // owner/name repository. ErrNotGitHub = errors.New("not a GitHub repository URL") // ErrInvalidPath is returned for a directory or file name that is absolute // or leaves the location's directory. ErrInvalidPath = errors.New("path leaves the repository directory") )
Functions ¶
This section is empty.
Types ¶
type Location ¶
type Location struct {
Repository Repository
Branch string
// Directory is repository-relative without a leading "./" or trailing "/";
// the empty string is the repository root.
Directory string
}
Location is where a target's files live: a directory on a branch of a repository.
type Repository ¶
Repository is a GitHub repository.
func ParseRepositoryURL ¶
func ParseRepositoryURL(raw string) (Repository, error)
ParseRepositoryURL returns the GitHub repository a Flux GitRepository URL names, in its https, ssh:// or scp-like git@ form, with or without ".git", on github.com or on GitHub's SSH endpoint on port 443, ssh.github.com.