engine

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Mar 5, 2026 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	IncludeOriginSource   = "source"
	IncludeOriginExplicit = "explicit"

	IncludeMissingHintSourceMissing             = "source_missing"
	IncludeMissingHintSourceMissingTargetExists = "source_missing_target_exists"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Action

type Action struct {
	Op     string `json:"op"`
	Path   string `json:"path"`
	Status string `json:"status"`
}

type ApplyOptions

type ApplyOptions struct {
	From    string
	Include string
	DryRun  bool
	Force   bool
}

type CLIError

type CLIError struct {
	Code int
	Msg  string
	Err  error
}

func (*CLIError) Error

func (e *CLIError) Error() string

func (*CLIError) Unwrap

func (e *CLIError) Unwrap() error

type DoctorOptions

type DoctorOptions struct {
	From    string
	Include string
}

type DoctorReport

type DoctorReport struct {
	TargetRoot         string
	SourceRoot         string
	FromMode           string
	IncludePath        string
	IncludeFound       bool
	IncludeOrigin      string
	IncludeMissingHint string
	TargetIncludePath  string
	PatternCount       int
	Result             Result
}

type Engine

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

func NewEngine

func NewEngine() *Engine

func (*Engine) Apply

func (e *Engine) Apply(ctx context.Context, cwd string, opts ApplyOptions) (Result, int, error)

func (*Engine) Doctor

func (e *Engine) Doctor(ctx context.Context, cwd string, opts DoctorOptions) (DoctorReport, error)

func (*Engine) HookPath

func (e *Engine) HookPath(ctx context.Context, cwd string, absolute bool) (string, error)

type Result

type Result struct {
	From        string   `json:"from"`
	To          string   `json:"to"`
	IncludeFile string   `json:"include_file"`
	Summary     Summary  `json:"summary"`
	Actions     []Action `json:"actions"`

	// Non-JSON metadata for human-readable CLI output.
	ResolvedIncludePath string `json:"-"`
	IncludeFound        bool   `json:"-"`
	IncludeOrigin       string `json:"-"`
	IncludeMissingHint  string `json:"-"`
	TargetIncludePath   string `json:"-"`
	PatternCount        int    `json:"-"`
}

type Summary

type Summary struct {
	Matched           int `json:"matched"`
	Copied            int `json:"copied"`
	SkippedSame       int `json:"skipped_same"`
	SkippedMissingSrc int `json:"skipped_missing_src"`
	Conflicts         int `json:"conflicts"`
	Errors            int `json:"errors"`
}

Jump to

Keyboard shortcuts

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