Documentation
¶
Overview ¶
Package cleanup applies a manifest against live NATS clusters.
Apply is the operationally important function. It is shared by the `natsie consumer apply` CLI and the bot's signed-approval HTTP handler, so both code paths run the same re-verification and deletion logic.
Two safety properties are baked in:
Re-verification: each entry's current state is re-queried before deletion. Anything that has become active (push-bound, has pull waiters, or has acked since the manifest's GeneratedAt) is preserved untouched.
Per-entry deletes via the raw `$JS.API.CONSUMER.DELETE` subject, so consumer names starting with `-` (which the nats CLI rejects as flags) are handled the same way as any other name.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Connector ¶
Connector returns a NATS connection for the named cluster, along with a function the caller invokes to release it. The CLI passes natsctx.Connect-backed connectors; tests can pass an in-memory fake.
type Result ¶
Result is the outcome of an Apply call.
func Apply ¶
func Apply(ctx context.Context, m *manifest.Manifest, dryRun bool, connect Connector) (*Result, error)
Apply groups the manifest entries by cluster, dials each cluster once via the Connector, and runs the re-verification + deletion loop. DryRun reports actions without sending delete requests.