Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ErrConflict = errors.New("file changed outside Beech")
ErrConflict means that another process changed the file after Beech loaded it.
Functions ¶
Types ¶
type Fingerprint ¶
Fingerprint identifies the file content used by the current document.
func Save ¶
func Save(path string, data []byte, expected Fingerprint, mode fs.FileMode) (Fingerprint, error)
Save atomically writes data if the target still matches expected.
type LoadedFile ¶
type LoadedFile struct {
Path string
Data []byte
Fingerprint Fingerprint
Mode fs.FileMode
}
LoadedFile is the result of loading a document path.
func Load ¶
func Load(path string) (LoadedFile, error)
Load reads path and resolves a symlink so atomic saves do not replace it.