gitrepo

package
v0.2.0-rc.2 Latest Latest
Warning

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

Go to latest
Published: Nov 18, 2026 License: GPL-3.0 Imports: 21 Imported by: 1 module, 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

This section is empty.

Functions

func WriteSourceRepoURLs

func WriteSourceRepoURLs(path, repoRoot string) error

WriteSourceRepoURLs writes source-repo aliases for a materialized tree. This lets archived git revision snapshots resolve self-referential GitRepository URLs.

func WriteSourceRepoURLsContext

func WriteSourceRepoURLsContext(ctx context.Context, path, repoRoot string) error

WriteSourceRepoURLsContext writes source aliases while honoring cancellation during Git discovery. Like WriteSourceRepoURLs, non-Git paths have no aliases.

Types

type Expander

type Expander struct {
	// contains filtered or unexported fields
}

Expander discovers GitRepository resources, clones external repos to temp directories, and makes their paths available for the expansion loop.

func NewExpander

func NewExpander(log logr.Logger) (*Expander, error)

NewExpander creates a GitRepository expander. Close must be called when done to remove cloned repositories.

func NewLocalExpander

func NewLocalExpander(root string, log logr.Logger) *Expander

NewLocalExpander resolves only local sources, without allocating a clone directory.

func (*Expander) Cleanup

func (e *Expander) Cleanup()

Cleanup removes all cloned repositories.

func (*Expander) Close

func (e *Expander) Close() error

Close removes cloned repositories once, after all rendering has stopped.

func (*Expander) Expand

Expand implements expander.Expander.

func (*Expander) ResolvePath

func (e *Expander) ResolvePath(namespace, name string) (string, bool)

ResolvePath returns the local filesystem path for a GitRepository source. Returns ("", false) if the repository hasn't been cloned.

func (*Expander) SetLocalOnly

func (e *Expander) SetLocalOnly()

SetLocalOnly disables cloning and scopes local sources to the current root.

func (*Expander) WithSourceRoot

func (e *Expander) WithSourceRoot(path string) *Expander

WithSourceRoot returns a copy of the expander scoped to one source root. External clones remain shared, while local path aliases are per invocation.

Jump to

Keyboard shortcuts

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