Documentation
¶
Overview ¶
Package credfile keeps files in one private directory held open as a root: the custody the credential store's file needs, and the one package of this module that names the atomic-file dependency.
Its errors keep the dependency's text, save the mode refusal's, and wrap only this package's sentinels and the platform's errno, never the dependency's values, so nothing a consumer matches with errors.Is or errors.As ties it to that dependency's next major.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ( // ErrNotPrivate is a directory with group or other access or another owner. ErrNotPrivate = errors.New("creds: the credential directory is not private to this process") // ErrNotSynced is an Open failure that left the directory in place; calling Open // again is safe. ErrNotSynced = errors.New("creds: the credential directory's parent was not synced; opening it again is safe") )
Functions ¶
This section is empty.
Types ¶
type Dir ¶
type Dir struct {
// contains filtered or unexported fields
}
Dir is one private directory under a retained root handle.
func Open ¶
Open establishes custody of one directory level: created at 0700 where absent, refused with ErrNotPrivate where it pre-exists with group or other access or another owner, and then held as a root whose own handle is checked again, because opening the root by name re-resolves the path the custody check vouched for. A failure matching ErrNotSynced leaves the directory in place, and calling Open again is safe. Every call into the dependency carries logger, since the dependency otherwise logs to a sink this library does not own.