Documentation
¶
Overview ¶
Package flagfile handles the flag files an object keeps in its var directory, where the presence of the file is the flag and its modification time is when the flag was raised.
A flag file is what makes a decision survive a daemon restart or a reboot: the frozen flag says the daemon may not act on the instance, the stopped flag says the daemon may not start it back on its own.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Content ¶
Content returns the content the flag was raised with, empty when it was raised with none or is not raised.
func Set ¶
Set raises the flag, creating the var directory if needed. Setting a flag already raised leaves its time alone: the flag says when the decision was made, and it was made the first time.
Types ¶
type Raised ¶
type Raised struct {
// contains filtered or unexported fields
}
Raised is a flag a call of Raise raised, until it is kept or lowered.
It holds the file it created open, so the file is told apart from one created at the same path after it was removed, which may take its inode when it is free.
func Raise ¶
Raise raises the flag as Set does, for a caller that may have to take it away again, as a write that raised it for itself and did not land. It returns nil when the flag was raised already, as it is not the caller's to take away. The flag returned, raised even with an error, as a file created and not synced, is to be kept or lowered.