Documentation
¶
Overview ¶
Package sourceview resolves portable repository identities to exactly one local checkout per repository for one command invocation.
Index ¶
- Constants
- func IsError(err error) bool
- func SelectionError(message string) error
- type Binding
- type Config
- type LocalConfig
- type Repository
- type ResolvedView
- func Failed(name string, err error) *ResolvedView
- func Resolve(root string, cfg Config, selected string) (*ResolvedView, error)
- func ResolveCommittedBindings(root string, cfg Config, local LocalConfig, selected string, ...) (*ResolvedView, error)
- func ResolveWithBindings(root string, cfg Config, local LocalConfig, selected string) (*ResolvedView, error)
- type Selection
- type Source
- type View
Constants ¶
const EnvName = "FACET_SOURCE_VIEW"
const LocalName = ".facet/sources.local.yaml"
Variables ¶
This section is empty.
Functions ¶
func SelectionError ¶
Types ¶
type Config ¶
type Config struct {
Repositories map[string]Repository `yaml:"repositories" json:"repositories"`
RegistryRepository string `yaml:"registry_repository,omitempty" json:"registry_repository,omitempty"`
DefaultView string `yaml:"default_view,omitempty" json:"default_view,omitempty"`
Views map[string]View `yaml:"views" json:"views"`
}
func (*Config) UnmarshalYAML ¶
UnmarshalYAML keeps this opt-in block closed even though older project-wide configuration permits plugin-specific extensions elsewhere. Personal checkout locations belong only in the ignored local bindings file.
type LocalConfig ¶
func (*LocalConfig) UnmarshalYAML ¶
func (c *LocalConfig) UnmarshalYAML(unmarshal func(any) error) error
type Repository ¶
type Repository struct {
Description string `yaml:"description,omitempty" json:"description,omitempty"`
}
type ResolvedView ¶
type ResolvedView struct {
Name string `json:"name"`
RegistryRepository string `json:"registry_repository,omitempty"`
Sources map[string]Source `json:"sources"`
Repositories map[string]Repository `json:"repositories"`
// contains filtered or unexported fields
}
func Failed ¶
func Failed(name string, err error) *ResolvedView
func ResolveCommittedBindings ¶
func ResolveCommittedBindings(root string, cfg Config, local LocalConfig, selected string, revisions map[string]string) (*ResolvedView, error)
ResolveCommittedBindings validates identities and refs without reading working tree content. The calling revision verifier materializes the returned commits.
func ResolveWithBindings ¶
func ResolveWithBindings(root string, cfg Config, local LocalConfig, selected string) (*ResolvedView, error)
@facet: registry/layout/source-views @facet-role: primary
func (*ResolvedView) Ordered ¶
func (v *ResolvedView) Ordered() []Source
func (*ResolvedView) Qualify ¶
func (v *ResolvedView) Qualify(repository, relative string) (string, error)
func (*ResolvedView) ResolveReference ¶
func (v *ResolvedView) ResolveReference(ref string) (Source, string, error)
func (*ResolvedView) Validate ¶
func (v *ResolvedView) Validate() error
type Source ¶
type Source struct {
Repository string `json:"repository"`
Binding string `json:"binding"`
Root string `json:"-"`
Ref string `json:"ref,omitempty"`
Revision string `json:"revision"`
Dirty bool `json:"dirty"`
ContentHash string `json:"content_hash"`
// contains filtered or unexported fields
}
func (Source) Read ¶
Read validates the requested file against the invocation snapshot. Callers publishing an aggregate result must also Validate the complete view before and after their operation; this avoids rehashing every repository per file.