Documentation
¶
Index ¶
- func Apply(ctx context.Context, plan *Plan) error
- func CompatibilityAssetPaths(sourceFamily string) ([]string, error)
- func IsKnownLegacyMarkerFile(relativePath string, body []byte) bool
- func RenderCompatibilityAsset(project Project, relativePath, targetCLIVersion string) ([]byte, error)
- func ValidateTargetCLIVersion(raw string) (string, error)
- func WritePlan(output io.Writer, plan Plan) error
- type Change
- type Diagnostic
- type Marker
- type Plan
- type Project
- type SourceFixture
- type Status
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Apply ¶
Apply writes exactly the changes in plan after revalidating Git state and every input digest. A failure rolls back files written by this invocation.
func CompatibilityAssetPaths ¶
CompatibilityAssetPaths returns the existing paths that the selected source family can map to pkg v0.5.0-compatible managed content.
func IsKnownLegacyMarkerFile ¶
IsKnownLegacyMarkerFile recognizes only the exact frozen public/embed.go output affected by the historical non-.tmpl generator bug.
func RenderCompatibilityAsset ¶
func RenderCompatibilityAsset(project Project, relativePath, targetCLIVersion string) ([]byte, error)
RenderCompatibilityAsset renders one frozen asset entirely in memory.
func ValidateTargetCLIVersion ¶
ValidateTargetCLIVersion accepts only a stable, release-build semantic version and returns the marker representation without a leading v.
Types ¶
type Diagnostic ¶
func ScanManualActions ¶
func ScanManualActions(project Project, changedPaths map[string]struct{}, targetCLIVersion string) ([]Diagnostic, error)
ScanManualActions reports known pkg v0.5.0 incompatibilities without modifying source. Paths already replaced by the managed plan are excluded. targetCLIVersion is the migration target used to recognize up-to-date generate.sh content.
type Marker ¶
Marker is a strict first-line grpc-kit-cli ownership declaration.
func ParseMarkerLine ¶
ParseMarkerLine parses an exact Go or script marker. Similar comments, placeholders and non-canonical versions do not grant write ownership.
type Plan ¶
type Plan struct {
Project Project
FromCLIVersions []string
TargetCLIVersion string
TargetPkgVersion string
Status Status
Changes []Change
Warnings []Diagnostic
ApplyBlockers []Diagnostic
ManualActions []Diagnostic
Conflicts []Diagnostic
}
type Project ¶
type Project struct {
Root string
ModulePath string
SourceCLIVersion string
SourceFamily string
ProductCode string
ShortName string
APIVersion string
}
Project contains the identity required to render managed migration assets.
func LoadProject ¶
LoadProject identifies a project without executing its scripts or changing any files.
type SourceFixture ¶
type SourceFixture struct {
Name string
Commit string
ProjectCLIVersion string
Files map[string]string
}
SourceFixture records the immutable evidence used to select compatibility assets. SHA-256 values are over the exact Git blob contents at Commit.
func CLIV038SourceFixture ¶
func CLIV038SourceFixture() SourceFixture
CLIV038SourceFixture returns a defensive copy of the official v0.3.8 template evidence.
func SpiderSourceFixture ¶
func SpiderSourceFixture() SourceFixture
SpiderSourceFixture returns a defensive copy of the frozen source evidence.