Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ConditionFunc ¶ added in v1.2.2
type ConfigLayer ¶ added in v1.2.2
type ConfigLayer string
const ( LayerSystem ConfigLayer = "system" LayerUser ConfigLayer = "user" LayerRepo ConfigLayer = "repo" LayerCWD ConfigLayer = "cwd" LayerExplicit ConfigLayer = "explicit" )
type Plan ¶ added in v1.2.2
type Plan struct {
// contains filtered or unexported fields
}
func NewPlan ¶ added in v1.2.2
func NewPlan(opts ...PlanOption) *Plan
func (*Plan) Add ¶ added in v1.2.2
func (p *Plan) Add(sources ...SourceSpec) *Plan
func (*Plan) Explain ¶ added in v1.2.2
func (p *Plan) Explain(ctx context.Context) (*PlanReport, error)
func (*Plan) Resolve ¶ added in v1.2.2
func (p *Plan) Resolve(ctx context.Context) ([]ResolvedConfigFile, *PlanReport, error)
type PlanOption ¶ added in v1.2.2
type PlanOption func(*Plan)
func WithDedupePaths ¶ added in v1.2.2
func WithDedupePaths() PlanOption
func WithLayerOrder ¶ added in v1.2.2
func WithLayerOrder(layers ...ConfigLayer) PlanOption
type PlanReport ¶ added in v1.2.2
type PlanReport struct {
Sources []ResolvedSource
Files []ResolvedConfigFile
}
func (*PlanReport) Paths ¶ added in v1.2.2
func (r *PlanReport) Paths() []string
func (*PlanReport) String ¶ added in v1.2.2
func (r *PlanReport) String() string
type ResolvedConfigFile ¶ added in v1.2.2
type ResolvedConfigFile struct {
Path string
Layer ConfigLayer
SourceName string
SourceKind string
Index int
}
type ResolvedSource ¶ added in v1.2.2
type SourceSpec ¶ added in v1.2.2
type SourceSpec struct {
Name string
Layer ConfigLayer
SourceKind string
Discover DiscoverFunc
Optional bool
StopIfFound bool
EnabledIf ConditionFunc
}
func ExplicitFile ¶ added in v1.2.2
func ExplicitFile(path string) SourceSpec
func GitRootFile ¶ added in v1.2.2
func GitRootFile(name string) SourceSpec
GitRootFile discovers an optional config file relative to the Git worktree containing the current process working directory. Discovery intentionally ignores Git's local repository environment variables (the variables reported by `git rev-parse --local-env-vars`, such as GIT_DIR and GIT_WORK_TREE) so callers launched from Git hooks still discover the repository for their cwd rather than the repository whose hook invoked them. General Git configuration variables such as GIT_SSH_COMMAND and GIT_TRACE are preserved.
func HomeAppConfig ¶ added in v1.2.2
func HomeAppConfig(appName string) SourceSpec
func SystemAppConfig ¶ added in v1.2.2
func SystemAppConfig(appName string) SourceSpec
func WorkingDirFile ¶ added in v1.2.2
func WorkingDirFile(name string) SourceSpec
func XDGAppConfig ¶ added in v1.2.2
func XDGAppConfig(appName string) SourceSpec
func (SourceSpec) InLayer ¶ added in v1.2.2
func (s SourceSpec) InLayer(layer ConfigLayer) SourceSpec
func (SourceSpec) Kind ¶ added in v1.2.2
func (s SourceSpec) Kind(kind string) SourceSpec
func (SourceSpec) Named ¶ added in v1.2.2
func (s SourceSpec) Named(name string) SourceSpec
func (SourceSpec) When ¶ added in v1.2.2
func (s SourceSpec) When(enabledIf ConditionFunc) SourceSpec
Click to show internal directories.
Click to hide internal directories.