hookgate

package
v1.2.14 Latest Latest
Warning

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

Go to latest
Published: Oct 12, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Package hookgate is the hook gate as the nova-tools tools meet it (docs/SPEC-HOOK.md, the gate in every tool; tla/Hook.tla, GateMeansHooked): the hook module's Gate over the bus store a verb already opened, and the gate's answer as the verb's one result. Every verb that sends, reads or takes work as an identity calls Gate before it acts and acts only on nil.

Index

Constants

View Source
const Reason = "unhooked"

Reason is the stable code of a gate's no, a result's reason (tool.Out.Reasons).

Variables

View Source
var ErrNoRecord = errors.New("this bus store keeps no hook record (it is no Redis store), so nothing runs: fail closed")

ErrNoRecord is the refusal of a bus store that is no Redis: no hook record can be read from it, so nothing runs.

Functions

func Gate

func Gate(ctx context.Context, st bus.Store, w hook.Want) error

Gate is the gate for w over the bus store st: nil when w.Name is hooked in, every push of its role live and proven; else the hook's Refusal, or the store's error (fail closed: only nil lets a verb act).

func Out

func Out(err error) *tool.Out

Out is a gate's no as a verb's result: an identity not hooked in is FAILED at exit 1, reason unhooked, the hook command its remedy and every other line of the breadcrumb a NOTE; a record that could not be read is REFUSED at exit 2, the gate unable to decide (fail closed). nil for nil.

func Store

func Store(st bus.Store) (hook.Store, error)

Store is the hook record's store over the bus store st: the same Redis.

Types

This section is empty.

Jump to

Keyboard shortcuts

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