killswitch

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Sep 4, 2026 License: GPL-3.0 Imports: 5 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package killswitch is the freeze: one file whose existence means "deny everything". It is a file rather than a socket or a signal so that `agentgate freeze` works from any shell, against any number of running gateways, with no proxy running at all, and survives a restart.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Engaged

func Engaged(path string) bool

Engaged is the cheap check the proxy makes on every call.

func Release

func Release(path string) error

Release lifts the freeze. Releasing a gateway that is not frozen is fine.

Types

type State

type State struct {
	Reason string    `json:"reason"`
	By     string    `json:"by"`
	At     time.Time `json:"at"`
}

State is what the marker file records.

func Engage

func Engage(path, reason, by string) (State, error)

Engage throws the switch. It is idempotent: freezing twice keeps the first reason, because the first reason is the interesting one.

func Status

func Status(path string) (State, bool)

Status reports whether the switch is thrown, and what the marker says. A marker that cannot be parsed still counts as frozen: failing open is not an option for a kill switch.

Jump to

Keyboard shortcuts

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