safety

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Jul 29, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Package safety decides whether a request is allowed to leave the machine.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Confirmer

type Confirmer func(prompt string) (bool, error)

Confirmer asks the user to approve a mutation. It is only ever called when stdin is a terminal.

type Gate

type Gate struct {
	Readonly    bool
	Yes         bool
	Interactive bool
	DryRun      bool
	Confirm     Confirmer
}

Gate applies the three safety rules.

func (Gate) Check

func (g Gate) Check(method, url, envName string) error

Check runs the rules in order: readonly first, because no flag may override it.

Jump to

Keyboard shortcuts

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