Documentation
¶
Overview ¶
Package gittree admits direct inputs and lazy Git tree views.
Index ¶
- func AdmitDirectory(ctx context.Context, location *gitrepo.Location) (*store.SourceArtifact, error)
- func ContentFingerprint(ctx context.Context, input fs.FS) (string, error)
- func ExcludeDirectory(input *store.SourceArtifact, directory string) *store.SourceArtifact
- func Label(opts LabelOptions) (string, string)
- func NormalizeSparsePaths(paths []string) []string
- func Sub(input fs.FS, dir string) (fs.FS, error)
- type FS
- func (g *FS) FileDigests() map[string]string
- func (g *FS) FreshInputs(ctx context.Context, requested []string) (InputObservations, error)
- func (g *FS) Location() *gitrepo.Location
- func (g *FS) Lstat(name string) (fs.FileInfo, error)
- func (g *FS) Open(name string) (fs.File, error)
- func (g *FS) OpenRegular(name string) (fs.File, error)
- func (g *FS) OperationView() *FS
- func (g *FS) PolicyEvidence() any
- func (g *FS) ReadDir(name string) ([]fs.DirEntry, error)
- func (g *FS) ReadFile(name string) ([]byte, error)
- func (g *FS) ReadLink(name string) (string, error)
- func (g *FS) SourcePolicy(ctx context.Context) (*sourceignore.Matcher, error)
- func (g *FS) Stat(name string) (fs.FileInfo, error)
- type InputObservations
- type LabelOptions
- type ViewMode
- type ViewOptions
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AdmitDirectory ¶ added in v0.7.3
AdmitDirectory constructs the direct input artifact at the resolved local root. Synthetic source labels MUST use their already admitted filesystem instead.
func ContentFingerprint ¶ added in v0.7.3
ContentFingerprint identifies selected bytes once per stable admitted view. Immutable views retain their acquisition identity; mutable identities remain separate.
func ExcludeDirectory ¶ added in v0.7.3
func ExcludeDirectory(input *store.SourceArtifact, directory string) *store.SourceArtifact
ExcludeDirectory retains immutable source membership without the resolved active cache directory. Callers MUST supply the cache owner's directory before source observations begin.
func Label ¶ added in v0.7.3
func Label(opts LabelOptions) (string, string)
Label returns an ownership coordinate and its key without accessing the filesystem.
func NormalizeSparsePaths ¶ added in v0.7.3
NormalizeSparsePaths removes one leading ./ from each sparse selection. The result may share backing with paths and MUST remain immutable.
Types ¶
type FS ¶ added in v0.7.3
type FS struct {
// Warnings is immutable admission evidence, nil when no advisory was observed.
Warnings []manifest.Warning
// contains filtered or unexported fields
}
FS is an admitted filesystem. Its representation is selected once by New.
func New ¶ added in v0.7.3
func New(ctx context.Context, backing billy.Filesystem, commit plumbing.Hash, opts ViewOptions) (*FS, string, error)
New validates Git metadata and creates views without reading regular blob bodies. Mutable views refresh before reuse or construction; committed identities stay pinned. An error may return warning evidence without a usable filesystem.
func (*FS) FileDigests ¶ added in v0.7.3
FileDigests borrows completed selected-file evidence without reading content. Returned maps MUST remain read-only.
func (*FS) FreshInputs ¶ added in v0.7.3
FreshInputs MUST observe mutable bytes and membership without prior operation memos or Git stat evidence. A nil request observes every file. An explicit request reads only those bodies while retaining complete node membership.
func (*FS) Location ¶ added in v0.7.3
Location returns the resolved disk identity retained by admission.
func (*FS) OpenRegular ¶ added in v0.7.3
OpenRegular applies membership before the regular-file shortcut.
func (*FS) OperationView ¶ added in v0.7.3
OperationView creates private local observations while retaining admitted membership.
func (*FS) PolicyEvidence ¶ added in v0.7.3
PolicyEvidence returns the ordered ignore-file content used to shape the view. Policy evidence MUST NOT be used as immutable source acquisition authority.
func (*FS) ReadDir ¶ added in v0.7.3
ReadDir omits the excluded directory without mutating shared listings.
func (*FS) ReadFile ¶ added in v0.7.3
ReadFile keeps optimized file reads within admitted membership.
func (*FS) SourcePolicy ¶ added in v0.7.3
SourcePolicy returns the admission's captured Flux policy without reshaping its files.
type InputObservations ¶ added in v0.7.3
InputObservations borrows current file identities and node kinds from one source observation. Both maps MUST remain read-only.
type LabelOptions ¶ added in v0.7.3
type LabelOptions struct {
Root, Key string
Mode ViewMode
Source manifest.NamedResource
Content any
}
LabelOptions supplies ownership coordinates independently of acquisition identity.
type ViewMode ¶ added in v0.7.3
type ViewMode uint8
ViewMode selects admitted input and source artifact membership.
type ViewOptions ¶ added in v0.7.3
type ViewOptions struct {
// Content carries source coordinates without filesystem or routing state.
Content any
Location *gitrepo.Location
Mode ViewMode
Sparse []string
Ignore string
Worktree billy.Filesystem
// Current supplies admitted bytes; Git views also expose read-only local objects.
Current fs.FS
// CurrentContent carries the acquisition owner's identity when Current wraps its admitted view.
CurrentContent string
// Changes routes complete, unfiltered differences to commit bodies.
Changes []string
// contains filtered or unexported fields
}
ViewOptions shapes a commit view without changing its object backing.