package
Version:
v1.0.63
Opens a new window with list of versions in this module.
Published: Oct 3, 2026
License: Apache-2.0
Opens a new window with license information.
Imports: 4
Opens a new window with list of imports.
Imported by: 0
Opens a new window with list of known importers.
Documentation
¶
Package atomicfile 提供不依赖命令层的安全原子文件写入。
Write 将 data 通过同目录临时文件、fsync 和 rename 原子写入 path。
WriteJSON 使用 0600 权限原子写入 JSON 数据。
WriteWithOps 执行原子写入;Ops 仅供兼容测试注入和受控封装使用。
Ops 允许上层保留已有的故障注入测试,同时把写入算法集中在本包。
TempFile 是原子写入所需的最小临时文件接口。
Source Files
¶
Click to show internal directories.
Click to hide internal directories.