Documentation
¶
Index ¶
Constants ¶
const ManifestFileName = ".manifest.json"
ManifestFileName is the name of the manifest file written alongside installed skill files.
const SiteSkillName = "markata-go-site"
SiteSkillName is the default bundled skill name for markata-go sites.
Variables ¶
This section is empty.
Functions ¶
func WriteManifest ¶
WriteManifest serializes the manifest to JSON and writes it to the given directory.
Types ¶
type DriftEntry ¶
type DriftEntry struct {
Path string
Status FileStatus
}
DriftEntry describes the drift state of a single file.
type DriftReport ¶
type DriftReport struct {
InstalledVersion string
CurrentVersion string
VersionMismatch bool
Files []DriftEntry
}
DriftReport holds the comparison between installed and bundled skill files.
func ComputeDrift ¶
func ComputeDrift(installed *Manifest, skillDir, currentVersion string) (*DriftReport, error)
ComputeDrift compares an installed skill directory against the current bundled skill.
func (*DriftReport) HasDrift ¶
func (r *DriftReport) HasDrift() bool
HasDrift returns true if any file is not in the ok state.
func (*DriftReport) IssueCount ¶
func (r *DriftReport) IssueCount() int
IssueCount returns the number of files that are not ok.
type FileStatus ¶
type FileStatus string
FileStatus describes the drift state of a single file.
const ( FileOK FileStatus = "ok" FileModified FileStatus = "modified" FileNew FileStatus = "new" FileMissing FileStatus = "missing" )
type Manifest ¶
type Manifest struct {
Version string `json:"version"`
InstalledAt time.Time `json:"installed_at"`
Target string `json:"target"`
Scope string `json:"scope,omitempty"`
Files map[string]string `json:"files"`
}
Manifest records the state of an installed skill for drift detection.
func ComputeBundledManifest ¶
ComputeBundledManifest builds a Manifest from the current bundled skill files. The version, target, and scope fields are set by the caller.
func ReadManifest ¶
ReadManifest reads and parses a manifest file from the given skill directory.