hello

package
v1.7.0 Latest Latest
Warning

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

Go to latest
Published: Jul 21, 2026 License: MIT Imports: 2 Imported by: 0

README

hello — a minimal Interseptor extension

A copy-paste starting point for the Phase-1 in-process hook API. See docs/extensions.md for the full guide and internal/plugin/annotator for a complete, tested example that ships with the binary.

hello.go registers an OnFlowCaptured hook that logs one line per captured flow. It demonstrates the whole contract in ~30 lines:

  • narrow host interface (flowSource) instead of importing store;
  • non-blocking hook body — work happens in a goroutine;
  • opt-in Enable that no-ops on a nil host, so it can never misfire.

Turning it into a real extension

  1. Copy this directory to internal/plugin/<yourname>/ (Go can't build a hook into the binary from under examples/).
  2. Widen the host interface to the calls you need (AddFlowTags, GetFlow, CreateFinding, …) — *store.Store will satisfy it.
  3. Call your Enable(...) from cmd/interseptor, gated behind an env var or setting so default behavior is unchanged.
  4. Add a _test.go that drives your logic against a fake host — no proxy required.

Documentation

Overview

Package hello is a minimal, self-contained Interseptor extension example. It registers an OnFlowCaptured hook that logs one line per captured flow.

See docs/extensions.md for the full guide. To ship a real extension, copy this into internal/plugin/<name>/ and wire Enable into cmd/interseptor.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Enable

func Enable(src flowSource)

Enable registers the hello hook. No-op on a nil host so an accidental enable can never misfire. Call once at startup.

Types

This section is empty.

Jump to

Keyboard shortcuts

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