Documentation
¶
Index ¶
- Variables
- func AtomicWrite(parent string, fileName string, perm os.FileMode, data []byte) error
- func Lock(path string) (file *os.File, err error)
- func ReadOnlyLock(path string) (file *os.File, err error)
- func Unlock(lock *os.File) error
- func ValidatePathComponent(pathComponent string) error
- func WithLock(path string, function func() error) (err error)
- func WithReadOnlyLock(path string, function func() error) (err error)
Constants ¶
This section is empty.
Variables ¶
Functions ¶
func AtomicWrite ¶
func Lock ¶
Lock places an advisory write lock on the file, blocking until it can be locked.
If Lock returns nil, no other process will be able to place a read or write lock on the file until this process exits, closes f, or calls Unlock on it.
func ReadOnlyLock ¶
ReadOnlyLock places an advisory read lock on the file, blocking until it can be locked.
If ReadOnlyLock returns nil, no other process will be able to place a write lock on the file until this process exits, closes f, or calls Unlock on it.
func ValidatePathComponent ¶
ValidatePathComponent will enforce os specific filename restrictions on a single path component.
func WithLock ¶
WithLock executes the provided function after placing a write lock on `path`. The lock is released once the function has been run, regardless of outcome.
func WithReadOnlyLock ¶
WithReadOnlyLock executes the provided function after placing a read lock on `path`. The lock is released once the function has been run, regardless of outcome.
Types ¶
This section is empty.