repos

package
v0.51.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 5, 2026 License: MIT Imports: 10 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Cache *cache = NewDefaultCache()
View Source
var Registry = NewDefaultRegistry()

Functions

func EnsureRepoID

func EnsureRepoID(name string) string

func GetOrInstallTemplateFromGitURL added in v0.51.0

func GetOrInstallTemplateFromGitURL(url string, version string) (string, error)

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

func GetOrInstallTemplateFromRepoID(repoID string) (string, error)

InstallTemplateFromFQN tries to install a template from a fully qualified name (e.g. name@version)

func IsGitURL added in v0.51.0

func IsGitURL(s string) bool

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 IsRepoID

func IsRepoID(name string) bool

func MakeRepoID

func MakeRepoID(name, version string) string

func NameFromRepoID

func NameFromRepoID(name string) string

func New

func New(cacheDir string) *cache

NewTemplateCache creates a new template cache

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

func RepoNameFromGitURL(rawurl string) (string, error)

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

func SplitGitURLVersion(s string) (string, string)

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

func SplitRepoID(name string) (string, string)

SplitRepoID splits a qualified name into name and version

func VersionFromRepoID

func VersionFromRepoID(name string) string

Types

type TemplateRegistry

type TemplateRegistry struct {
	Name        string          `json:"name"`
	Description string          `json:"description"`
	Entries     []*git.RepoInfo `json:"entries"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL