Documentation
¶
Overview ¶
Package features provides a feature flag system for gating experimental functionality, with priority resolution from CLI overrides, config file values, and compiled-in defaults.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ( // TmuxInteractiveInput enables write support for tmux panes. TmuxInteractiveInput = Feature{ Name: "tmux_interactive_input", Default: true, Description: "Enable write support for tmux panes", } // TmuxInlineEdit enables inline file editing via tmux in the files plugin. TmuxInlineEdit = Feature{ Name: "tmux_inline_edit", Default: true, Description: "Enable inline file editing via tmux in the files plugin", } // NotesPlugin enables the notes plugin for capturing quick notes. NotesPlugin = Feature{ Name: "notes_plugin", Default: false, Description: "Enable the notes plugin for capturing quick notes", } )
Known feature flags - add new features here.
var ErrNotInitialized = errors.New("feature manager not initialized")
ErrNotInitialized is returned when the feature manager is not initialized.
Functions ¶
func Init ¶
Init initializes the feature flag manager with the given config. Should be called once at startup after config is loaded.
func IsEnabled ¶
IsEnabled checks if a feature is enabled. Priority: CLI override > config > default.
func IsKnownFeature ¶
IsKnownFeature returns true if the feature name is registered.
func SetEnabled ¶
SetEnabled updates a feature flag in the config and saves it. Returns an error if the config cannot be saved or if the manager is not initialized.
func SetOverride ¶
SetOverride sets a CLI override for a feature flag. Overrides take precedence over config values.