config

package
v1.2.4 Latest Latest
Warning

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

Go to latest
Published: Apr 28, 2026 License: MIT Imports: 7 Imported by: 4

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 ConditionFunc func(ctx context.Context) bool

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 DiscoverFunc added in v1.2.2

type DiscoverFunc func(ctx context.Context) ([]string, error)

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 ResolvedSource struct {
	Name            string
	Layer           ConfigLayer
	SourceKind      string
	DiscoveredPaths []string
	AddedPaths      []string
	DedupedPaths    []string
	Found           bool
	SkippedReason   string
}

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

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

Jump to

Keyboard shortcuts

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