Documentation
¶
Index ¶
- func AtomicWrite(path string, data []byte, perm os.FileMode) error
- func AtomicWriteFromReader(path string, reader io.Reader, perm os.FileMode) (int64, error)
- func AtomicWriteJSON(path string, data []byte) error
- func NewPublicCommands(runner executor.Runner) []*cobra.Command
- func NormalizeSkillName(input string) string
- func RegisterPublic(factory Factory)
- func ValidateNaming(vendor, name string) error
- type Factory
- type Handler
- type Manifest
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AtomicWrite ¶
AtomicWrite writes data to path atomically by creating a temp file in the same directory, writing and fsyncing the data, then renaming over the target. It replaces os.WriteFile for all config and download file writes.
os.WriteFile truncates the target before writing, so a process kill (CI timeout, OOM, Ctrl+C) between truncate and completion leaves the file empty or partial. AtomicWrite avoids this: on any failure the temp file is cleaned up and the original file remains untouched.
func AtomicWriteFromReader ¶
AtomicWriteFromReader atomically copies reader contents into path.
func AtomicWriteJSON ¶
AtomicWriteJSON is a convenience wrapper for writing JSON data atomically. It uses 0600 permissions by default for sensitive data.
func NormalizeSkillName ¶
NormalizeSkillName converts free-form skill names to a stable dash-case key.
func RegisterPublic ¶
func RegisterPublic(factory Factory)