dynamic

package
v1.77.0 Latest Latest
Warning

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

Go to latest
Published: Aug 17, 2026 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Overview

Package dynamic provides the module enablement intent rule: the highest- precedence enablement signal a module carries, folding the external enable/disable signals (explicit ModuleConfig intent and the deprecated global-hook dynamic enable). The two signals are resolved upstream into one tri-state by the getter (the global module's IsEnabled), which the rule turns into an asymmetric verdict: an enable intent is a soft Enable vote (requirement gates can still veto it), while a disable intent is a hard Forbid — an explicit user disable is final and cannot be re-enabled by any other rule.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Getter

type Getter func(module string) *bool

Getter reports a module's resolved enablement intent as a tri-state:

  • *true - the module is intended to be enabled;
  • *false - the module is intended to be disabled;
  • nil - no opinion; resolution defers to the rest of the chain.

type Rule

type Rule struct {
	// contains filtered or unexported fields
}

Rule is the module enablement intent rule. An enable intent is a soft Enable that overrides the floor and the bundle vote but not a requirement gate (those still Forbid from any position, so an Enable cannot override an unmet requirement). A disable intent is a hard Forbid: an explicit user disable is final and no other rule — bundle, enabled script, or floor — can re-enable it.

func NewRule

func NewRule(getter Getter, module string) *Rule

NewRule constructs a dynamic rule for the given module, resolving its intent through the getter at decision time.

func (*Rule) Decide

func (r *Rule) Decide() rule.Decision

Decide returns a soft Enable when the module is intended enabled, a hard Forbid when it is intended disabled, and Undefined when there is no opinion.

Jump to

Keyboard shortcuts

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