flagfile

package
v3.0.0-rc49 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 14, 2026 License: Apache-2.0 Imports: 4 Imported by: 0

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 At

func At(p string) time.Time

At returns the time the flag was raised, or the zero time when it is not.

func Content

func Content(p string) []byte

Content returns the content the flag was raised with, empty when it was raised with none or is not raised.

func Set

func Set(p string) error

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.

func SetWith

func SetWith(p string, b []byte) error

SetWith raises the flag like Set, with b as the content of the file, which says more about the decision than its time. Setting a flag already raised leaves its content alone too, as the decision it describes.

func Unset

func Unset(p string) error

Unset lowers the flag, and syncs the directory so the removal survives a crash.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL