Documentation ¶
Overview ¶
Package iptableswrapper is a wrapper interface for the iptables package
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type IPTablesIface ¶
type IPTablesIface interface { Exists(table, chain string, rulespec ...string) (bool, error) Insert(table, chain string, pos int, rulespec ...string) error Append(table, chain string, rulespec ...string) error AppendUnique(table, chain string, rulespec ...string) error Delete(table, chain string, rulespec ...string) error List(table, chain string) ([]string, error) NewChain(table, chain string) error ClearChain(table, chain string) error DeleteChain(table, chain string) error ListChains(table string) ([]string, error) ChainExists(table, chain string) (bool, error) HasRandomFully() bool }
IPTablesIface is an interface created to make code unit testable. Both the iptables package version and mocked version implement the same interface
func NewIPTables ¶
func NewIPTables(protocol iptables.Protocol) (IPTablesIface, error)
NewIPTables return a ipTables struct that implements IPTablesIface
Click to show internal directories.
Click to hide internal directories.