versioning

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: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ApplyPlan

func ApplyPlan(plan *VersionPlan, cwd string) error

func ApplyPlanWithOptions

func ApplyPlanWithOptions(plan *VersionPlan, cwd string, options ApplyOptions) error

func FormatPlanText

func FormatPlanText(plan *VersionPlan) string

func HookContextForPlan

func HookContextForPlan(plan *VersionPlan) mirrorhooks.Context

Types

type ApplyOptions

type ApplyOptions struct {
	Confirmed bool
	Runner    Runner
	Context   context.Context
	Hooks     *mirrorhooks.Session
}

type ExecRunner

type ExecRunner struct{}

func (ExecRunner) Run

func (ExecRunner) Run(cwd, name string, args ...string) ([]byte, error)

type Runner

type Runner interface {
	Run(cwd, name string, args ...string) ([]byte, error)
}

type VersionPlan

type VersionPlan struct {
	CurrentVersion string               `json:"current"`
	NextVersion    string               `json:"next"`
	Initial        bool                 `json:"initial,omitempty"`
	Source         string               `json:"source"`
	Output         []string             `json:"output"`
	ProjectName    string               `json:"project,omitempty"`
	ConfigPath     string               `json:"config"`
	Tag            string               `json:"tag,omitempty"`
	Actions        []VersionPlanAction  `json:"actions"`
	AllowDirty     bool                 `json:"allow_dirty"`
	CommitEnabled  bool                 `json:"commit_enabled"`
	PushEnabled    bool                 `json:"push_enabled"`
	DryRun         bool                 `json:"dry_run"`
	Applied        bool                 `json:"applied"`
	Completed      []string             `json:"completed,omitempty"`
	HookResults    []mirrorhooks.Result `json:"hooks,omitempty"`
}

func BuildPlan

func BuildPlan(cfg *config.MirrorConfig, cfgPath, target, cwd string) (*VersionPlan, error)

func BuildPlanWithRunner

func BuildPlanWithRunner(cfg *config.MirrorConfig, cfgPath, target, cwd string, runner Runner) (*VersionPlan, error)

type VersionPlanAction

type VersionPlanAction struct {
	Type           string   `json:"type"`
	Adapter        string   `json:"adapter,omitempty"`
	Path           string   `json:"path,omitempty"`
	Paths          []string `json:"paths,omitempty"`
	CurrentVersion string   `json:"current_version,omitempty"`
	NextVersion    string   `json:"next_version,omitempty"`
	Message        string   `json:"message,omitempty"`
	Tag            string   `json:"tag,omitempty"`
	IncludeCommit  bool     `json:"include_commit,omitempty"`
	IncludeTags    bool     `json:"include_tags,omitempty"`
}

Jump to

Keyboard shortcuts

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