Documentation
¶
Overview ¶
Package config loads the user-global config (~/.config/notenv/config.toml, not committed) and merges it with the project contract into an effective configuration. Storage target is machine-only; the contract contributes just the namespace.
Index ¶
Constants ¶
View Source
const ( DefaultBase = "notenv" ModePass = "passphrase" DefaultCacheTTL = time.Hour // master-key keyring cache DefaultBlobCacheTTL = time.Hour // local ciphertext cache (matches key cache; --refresh forces fresh) )
Variables ¶
This section is empty.
Functions ¶
func CacheScope ¶
CacheScope is the keyring cache key for a storage base. Length-prefixed on the remote so (remote, base) pairs can't alias: a plain "remote:base" join makes ("r","a:b") and ("r:a","b") collide.
Types ¶
type Effective ¶
type Effective struct {
Remote string // rclone remote name
Base string // path within the remote
Versioned bool // remote retains versions on overwrite
Namespace string
Mode string // crypto mode
CacheTTL time.Duration // master-key cache TTL; <= 0 disables caching
BlobCacheTTL time.Duration // local ciphertext cache TTL; <= 0 disables
}
Effective is the merged result of user config + contract overrides.
type User ¶
type User struct {
Storage struct {
Remote string `toml:"remote"`
Base string `toml:"base"`
// Versioned: the remote retains old object versions on overwrite
// (B2 does natively), so skip the ~3s server-side .prev backup copy.
Versioned bool `toml:"versioned"`
// CacheTTL bounds local ciphertext-cache lifetime (Go duration;
// "0" disables). Default 1h. Same-machine writes refresh the cache
// instantly; for another machine's change, `run --refresh` or wait
// out the TTL.
CacheTTL string `toml:"cache_ttl"`
} `toml:"storage"`
Crypto struct {
Mode string `toml:"mode"`
// CacheTTL is how long the passphrase cache may hold a passphrase
// (Go duration string; "0" disables caching). Default: 1h.
CacheTTL string `toml:"cache_ttl"`
} `toml:"crypto"`
}
Click to show internal directories.
Click to hide internal directories.