Documentation
¶
Overview ¶
Package fsutil holds small filesystem helpers shared across the CLI.
Index ¶
Constants ¶
const SecretDirMode os.FileMode = 0o700
SecretDirMode is the permission used for parent directories created on demand by WriteSecret.
const SecretFileMode os.FileMode = 0o600
SecretFileMode is the permission every file holding key material, passwords or tokens ends up with.
Variables ¶
This section is empty.
Functions ¶
func WriteSecret ¶
WriteSecret atomically writes data to path with mode 0600.
Unlike os.WriteFile, the resulting mode does not depend on whether the file already existed (os.WriteFile keeps an existing file's permissions) or on the process umask. The data is written to a temp file in the same directory, synced, chmod'ed to 0600 and renamed over the target, so readers never observe a partially written file. Missing parent directories are created with mode 0700; existing ones are left as-is.
Types ¶
This section is empty.