config

package
v0.0.0-...-8f9dc6d Latest Latest
Warning

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

Go to latest
Published: Aug 23, 2026 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultPackagePath = "package.json"
	DefaultJSRPath     = "jsr.json"
	DefaultTagTemplate = "v{version}"
)

Variables

This section is empty.

Functions

func JSONSchema

func JSONSchema() string

func Resolve

func Resolve(cwd, explicitPath, home string) (string, error)

Resolve applies Mirror's deterministic configuration precedence: explicit path, project mirror.yaml, then ~/.guiho/mirror/mirror.yaml.

Types

type AgentsConfig

type AgentsConfig struct {
	WriteChangelog bool   `yaml:"write_changelog,omitempty" json:"write_changelog"`
	ChangelogPath  string `yaml:"changelog_path,omitempty" json:"changelog_path"`
}

type GitConfig

type GitConfig struct {
	TagTemplate string `yaml:"tag_template,omitempty" json:"tag_template"`
	Commit      bool   `yaml:"commit,omitempty" json:"commit"`
	Push        bool   `yaml:"push,omitempty" json:"push"`
	AllowDirty  bool   `yaml:"allow_dirty,omitempty" json:"allow_dirty"`
}

type HookDefinition

type HookDefinition struct {
	Instructions []string `yaml:"instructions,omitempty" json:"instructions,omitempty"`
	Commands     []string `yaml:"commands,omitempty" json:"commands,omitempty"`
}

type HookEvent

type HookEvent string
const (
	HookBeforeEverything HookEvent = "before:everything"
	HookAfterEverything  HookEvent = "after:everything"
	HookBeforePlan       HookEvent = "before:plan"
	HookAfterPlan        HookEvent = "after:plan"
	HookOnPlanError      HookEvent = "on:plan-error"
	HookBeforeApply      HookEvent = "before:apply"
	HookAfterApply       HookEvent = "after:apply"
	HookOnApplyError     HookEvent = "on:apply-error"
	HookBeforeWrite      HookEvent = "before:write"
	HookAfterWrite       HookEvent = "after:write"
	HookOnWriteError     HookEvent = "on:write-error"
	HookBeforeCommit     HookEvent = "before:commit"
	HookAfterCommit      HookEvent = "after:commit"
	HookOnCommitError    HookEvent = "on:commit-error"
	HookBeforeTag        HookEvent = "before:tag"
	HookAfterTag         HookEvent = "after:tag"
	HookOnTagError       HookEvent = "on:tag-error"
	HookBeforePush       HookEvent = "before:push"
	HookAfterPush        HookEvent = "after:push"
	HookOnPushError      HookEvent = "on:push-error"
	HookOnError          HookEvent = "on:error"
)

func HookEvents

func HookEvents() []HookEvent

type HooksConfig

type HooksConfig map[HookEvent]HookDefinition

func (HooksConfig) CommandCount

func (hooks HooksConfig) CommandCount() int

func (HooksConfig) CommandEvents

func (hooks HooksConfig) CommandEvents() []HookEvent

func (HooksConfig) HasCommands

func (hooks HooksConfig) HasCommands() bool

type JSRConfig

type JSRConfig struct {
	Path string `yaml:"path,omitempty" json:"path"`
}

type JsrConfig

type JsrConfig = JSRConfig

JsrConfig is retained as a source-compatible alias for early Go consumers.

type MirrorConfig

type MirrorConfig struct {
	Schema  int           `yaml:"schema" json:"schema"`
	Project ProjectConfig `yaml:"project,omitempty" json:"project"`
	Version VersionConfig `yaml:"version" json:"version"`
	Package PackageConfig `yaml:"package,omitempty" json:"package"`
	JSR     JSRConfig     `yaml:"jsr,omitempty" json:"jsr"`
	Git     GitConfig     `yaml:"git,omitempty" json:"git"`
	Agents  AgentsConfig  `yaml:"agents,omitempty" json:"agents"`
	Hooks   HooksConfig   `yaml:"hooks,omitempty" json:"hooks"`
}

MirrorConfig is the normalized, semantically validated mirror.yaml contract.

func Load

func Load(path string) (*MirrorConfig, error)

Load strictly decodes exactly one YAML document and then validates semantics.

func LoadResolved

func LoadResolved(cwd, explicitPath, home string) (*MirrorConfig, string, error)

func (*MirrorConfig) Validate

func (cfg *MirrorConfig) Validate() error

type PackageConfig

type PackageConfig struct {
	Path           string   `yaml:"path,omitempty" json:"path"`
	AuxiliaryPaths []string `yaml:"auxiliary_paths,omitempty" json:"auxiliary_paths"`
}

type ProjectConfig

type ProjectConfig struct {
	Name       string `yaml:"name,omitempty" json:"name,omitempty"`
	NameSource string `yaml:"name_source,omitempty" json:"name_source,omitempty"`
}

type VersionConfig

type VersionConfig struct {
	Scheme       string   `yaml:"scheme" json:"scheme"`
	Source       string   `yaml:"source" json:"source"`
	Output       []string `yaml:"output" json:"output"`
	PrereleaseID string   `yaml:"prerelease_id,omitempty" json:"prerelease_id,omitempty"`
}

Jump to

Keyboard shortcuts

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