hooks

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Jul 10, 2026 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Overview

Package hooks runs the optional commands associated with a rule's create/delete lifecycle events. Commands are executed through "sh -c", so they support arguments, pipes and shell expansion. The rule's fields are injected as FWDCTL_* environment variables on top of fwdctl's own environment.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Run

func Run(command string, env []string) error

Run executes command through "sh -c", inheriting fwdctl's stdout/stderr. The given env entries (KEY=VALUE) are appended to fwdctl's environment. An empty command is a no-op and returns nil. A non-nil error is returned only when the command was run and exited non-zero.

func RunOnCreate

func RunOnCreate(rule *iptables.Rule) error

RunOnCreate runs the rule's on-create hook, if any.

func RunOnDelete

func RunOnDelete(rule *iptables.Rule) error

RunOnDelete runs the rule's on-delete hook, if any.

Types

This section is empty.

Jump to

Keyboard shortcuts

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