Documentation
¶
Index ¶
- Variables
- func EnsureRepoID(name string) string
- func GetOrInstallTemplateFromGitURL(url string, version string) (string, error)
- func GetOrInstallTemplateFromRepoID(repoID string) (string, error)
- func IsGitURL(s string) bool
- func IsRepoID(name string) bool
- func MakeRepoID(name, version string) string
- func NameFromRepoID(name string) string
- func New(cacheDir string) *cache
- func NewDefaultCache() *cache
- func NewDefaultRegistry() *registry
- func NewRegistry(registryDir, registryURL string) *registry
- func RepoNameFromGitURL(rawurl string) (string, error)
- func SplitGitURLVersion(s string) (string, string)
- func SplitRepoID(name string) (string, string)
- func VersionFromRepoID(name string) string
- type TemplateRegistry
Constants ¶
This section is empty.
Variables ¶
var Cache *cache = NewDefaultCache()
var Registry = NewDefaultRegistry()
Functions ¶
func EnsureRepoID ¶
func GetOrInstallTemplateFromGitURL ¶ added in v0.51.0
GetOrInstallTemplateFromGitURL resolves a template from a direct git url and version (a tag, branch or commit). The repo is cloned into the cache and checked out at the given version. If a matching clone already exists in the cache it is reused without touching the network.
func GetOrInstallTemplateFromRepoID ¶ added in v0.29.1
InstallTemplateFromFQN tries to install a template from a fully qualified name (e.g. name@version)
func IsGitURL ¶ added in v0.51.0
IsGitURL reports whether s looks like a git URL we can clone from directly, as opposed to a local path or a registry repo ID.
func MakeRepoID ¶
func NameFromRepoID ¶
func NewDefaultCache ¶
func NewDefaultCache() *cache
NewDefault creates a new template cache with default configuration
func NewDefaultRegistry ¶
func NewDefaultRegistry() *registry
func NewRegistry ¶
func NewRegistry(registryDir, registryURL string) *registry
func RepoNameFromGitURL ¶ added in v0.51.0
RepoNameFromGitURL derives a host-qualified cache name (e.g. github.com/me/tpl) from a git URL. The name is derived generically so that any host works (not only the ones a VCS-aware parser knows), and so that the https and scp forms of the same repo map to the same name. The url must not carry a @version suffix; strip it with SplitGitURLVersion first.
func SplitGitURLVersion ¶ added in v0.51.0
SplitGitURLVersion splits a git URL of the form <url>@<version> into its url and version parts. The version separator is only recognised at or after the start of the URL path, so neither the scp user@host nor http credentials (user@host) are mistaken for a version. The version may itself contain a slash (e.g. a branch name like release/1.0). If no version is present the returned version is empty.
func SplitRepoID ¶
SplitRepoID splits a qualified name into name and version