Documentation
¶
Index ¶
Constants ¶
View Source
const ( OutputChainName = "OUTPUT" InputChainName = "INPUT" )
Variables ¶
View Source
var ErrIptablesFailure = errors.New("iptables failure")
Functions ¶
This section is empty.
Types ¶
type CommandRunnerMock ¶
type CommandRunnerMock struct { ErrCommand string // contains filtered or unexported fields }
func NewCommandRunnerMock ¶
func NewCommandRunnerMock() CommandRunnerMock
func NewCommandRunnerMockWithTables ¶
func NewCommandRunnerMockWithTables() CommandRunnerMock
NewCommandRunnerMockWithTables returns CommandRunnerMock where outputs are configured to return first two lines of iptables output, i.e:
Chain INPUC (policy ACCEPT)
target prot opt source destination
For OUTPUT and INPUT table.
func (*CommandRunnerMock) AddIptablesListOutput ¶
func (i *CommandRunnerMock) AddIptablesListOutput(chain string, output string)
func (*CommandRunnerMock) PopIPv4Commands ¶
func (i *CommandRunnerMock) PopIPv4Commands() []string
func (*CommandRunnerMock) PopIPv6Commands ¶
func (i *CommandRunnerMock) PopIPv6Commands() []string
func (*CommandRunnerMock) RunCommand ¶
func (i *CommandRunnerMock) RunCommand(command string, args string) (string, error)
type IptablesOutput ¶
type IptablesOutput struct {
// contains filtered or unexported fields
}
func NewIptablesOutput ¶
func NewIptablesOutput(chain string) IptablesOutput
func (*IptablesOutput) AddRules ¶
func (i *IptablesOutput) AddRules(rules ...string)
func (*IptablesOutput) Get ¶
func (i *IptablesOutput) Get() string
Click to show internal directories.
Click to hide internal directories.