Skip to content

v0.3.0 — WriteFunc Streaming API

Choose a tag to compare

@LarsArtmann LarsArtmann released this 23 Jul 16:59
· 226 commits to master since this release

What's New

WriteFunc — streaming atomic writes

A new public API for writing large or incrementally-produced content without holding the full payload in memory:

err := atomicwrite.WriteFunc(path, func(w io.Writer) error {
    enc := json.NewEncoder(w)
    return enc.Encode(largeObject)
}, fp)

The callback receives a bufio.Writer (64KB buffer). The temp file is fsync'd before atomic rename, and TOCTOU fingerprint verification works identically to Write.

Other changes

  • Benchmark data generation extracted into a shared benchData helper
  • .gitattributes for cross-platform line-ending normalization
  • Marketing website launched at atomicwrite.lars.software

Full changelog: CHANGELOG.md