Documentation
¶
Overview ¶
Package setenabled implements the "enable or disable a rule" use case. It is the only mutation permitted on built-in rules. It toggles the disabled flag, reloads the registry snapshot, and returns the resulting rule view.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CommandHandler ¶
type CommandHandler interface {
Handle(ctx context.Context, cmd Command) (CommandResponse, error)
}
CommandHandler handles the setenabled use case.
type CommandResponse ¶
CommandResponse is the output of the setenabled use case: the affected rule, whether it is built-in, and its resulting enabled state.
type RuleStore ¶
type RuleStore interface {
GetRule(ctx context.Context, id string) (rule.Rule, error)
SetRuleDisabled(ctx context.Context, id string, disabled bool) error
}
RuleStore reads custom rules and toggles the disabled flag.
type UseCase ¶
type UseCase struct {
// contains filtered or unexported fields
}
UseCase enables or disables guardrail rules (built-in or custom).
func NewUseCase ¶
NewUseCase creates a new UseCase.