Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AtomicWrite ¶
AtomicWrite writes data to a file atomically using temp file + rename. Pattern extracted from oscal/writer.go and books/cache.go.
This ensures that: - Either the entire write succeeds or nothing is written (no partial files) - Concurrent readers see old data or new data, never partial data - Failures leave the original file intact
func AtomicWriteJSON ¶
AtomicWriteJSON writes JSON data atomically with pretty formatting.
func AtomicWriteJSONWithLock ¶
AtomicWriteJSONWithLock combines atomic write with file locking. Pattern extracted from oscal/writer.go WriteAssessmentResults().
Use this when multiple processes might write to the same file concurrently. Provides both atomicity (no partial writes) and mutual exclusion (no race conditions).
func RemoveAllWithRetry ¶
RemoveAllWithRetry removes path. On non-Windows platforms, this delegates directly to os.RemoveAll.
Types ¶
This section is empty.