Documentation
¶
Overview ¶
@index Symlink-safe atomic filesystem access rooted beneath one generated-content directory.
@index Atomic filesystem adapter for built-in Wiki compatibility snapshots.
Index ¶
- func LoadWikiIndex(path string) (*wiki.Index, error)
- type Root
- func (r *Root) MarkdownFiles() (map[string]time.Time, error)
- func (r *Root) ModTime(rel string) (time.Time, bool, error)
- func (r *Root) Read(rel string) ([]byte, bool, error)
- func (r *Root) Remove(rel string) error
- func (r *Root) Validate(rel string) error
- func (r *Root) Write(rel string, data []byte) error
- type WikiIndexWriter
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Root ¶
type Root struct {
// contains filtered or unexported fields
}
Root provides safe relative access below one generated-content directory. @intent centralize containment, symlink rejection, and atomic replacement for generated docs.
func NewRoot ¶
NewRoot binds safe generated-file operations to one output directory. @intent prevent application policy from handling absolute output paths.
func (*Root) MarkdownFiles ¶
MarkdownFiles inventories generated Markdown paths and modification times. @intent provide default-namespace lint fallback when no manifest exists.
func (*Root) ModTime ¶
ModTime returns generated-file freshness metadata without exposing os.FileInfo. @intent let docs lint compare source and generated timestamps through a narrow port.
func (*Root) Read ¶
Read returns a generated file and distinguishes absence from read failure. @intent support manifest and managed-file policy without exposing absolute paths.
func (*Root) Remove ¶
Remove deletes one validated stale generated file. @intent prune only the relative generated path selected by application manifest policy. @domainRule missing files are treated as an already-complete prune. @sideEffect removes a file below the configured root.
func (*Root) Validate ¶
Validate checks a generated path before a multi-file write begins. @intent fail generation preflight before any output when a path could escape or traverse a symlink.
type WikiIndexWriter ¶
type WikiIndexWriter struct{ Root string }
WikiIndexWriter maps namespaces to compatibility snapshot paths and atomically replaces JSON. @intent prevent readers from observing partial built-in Wiki index snapshots.
func NewWikiIndexWriter ¶
func NewWikiIndexWriter(root string) *WikiIndexWriter
NewWikiIndexWriter binds Wiki snapshots to the configured state directory. @intent preserve the default .ccg output root while allowing CLI-configured state paths.
func (*WikiIndexWriter) WriteWikiIndex ¶
func (w *WikiIndexWriter) WriteWikiIndex(_ context.Context, namespace string, idx *wiki.Index) error
WriteWikiIndex writes indented JSON through a same-directory temporary file and rename. @intent preserve the versioned built-in Wiki snapshot format at its namespace-specific path. @sideEffect creates the namespace directory and atomically replaces wiki-index.json.