Documentation ¶
Overview ¶
Copyright (c) Microsoft Corporation. Licensed under the MIT license.
Copyright (c) Microsoft Corporation. Licensed under the MIT license.
Index ¶
- type FakeIPTables
- func (f *FakeIPTables) AddBuiltinTargets(targets ...string)
- func (f *FakeIPTables) ChainExists(table iptables.Table, chain iptables.Chain) (bool, error)
- func (f *FakeIPTables) DeleteChain(table iptables.Table, chain iptables.Chain) error
- func (f *FakeIPTables) DeleteRule(table iptables.Table, chain iptables.Chain, args ...string) error
- func (f *FakeIPTables) EnsureChain(table iptables.Table, chain iptables.Chain) (bool, error)
- func (f *FakeIPTables) EnsureRule(position iptables.RulePosition, table iptables.Table, chain iptables.Chain, ...) (bool, error)
- func (f *FakeIPTables) FlushChain(table iptables.Table, chain iptables.Chain) error
- func (f *FakeIPTables) HasRandomFully() bool
- func (f *FakeIPTables) IsIPv6() bool
- func (f *FakeIPTables) Monitor(canary iptables.Chain, tables []iptables.Table, reloadFunc func(), ...)
- func (f *FakeIPTables) Present() bool
- func (f *FakeIPTables) Protocol() iptables.Protocol
- func (f *FakeIPTables) Restore(table iptables.Table, data []byte, flush iptables.FlushFlag, ...) error
- func (f *FakeIPTables) RestoreAll(data []byte, flush iptables.FlushFlag, counters iptables.RestoreCountersFlag) error
- func (f *FakeIPTables) SaveInto(table iptables.Table, buffer *bytes.Buffer) error
- func (f *FakeIPTables) SetHasRandomFully(can bool) *FakeIPTables
- type Interface
- type IpTables
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type FakeIPTables ¶ added in v0.0.8
type FakeIPTables struct {
// contains filtered or unexported fields
}
FakeIPTables is no-op implementation of iptables Interface. We create a wrapper for iptest.FakeIPTables because the original package does not contain enough builtinTargets we need.
func NewFake ¶ added in v0.0.8
func NewFake() *FakeIPTables
NewFake returns a no-op iptables.Interface
func NewIPv6Fake ¶ added in v0.0.8
func NewIPv6Fake() *FakeIPTables
NewIPv6Fake returns a no-op iptables.Interface with IsIPv6() == true
func (*FakeIPTables) AddBuiltinTargets ¶ added in v0.0.8
func (f *FakeIPTables) AddBuiltinTargets(targets ...string)
func (*FakeIPTables) ChainExists ¶ added in v0.0.8
ChainExists is part of iptables.Interface
func (*FakeIPTables) DeleteChain ¶ added in v0.0.8
DeleteChain is part of iptables.Interface
func (*FakeIPTables) DeleteRule ¶ added in v0.0.8
DeleteRule is part of iptables.Interface
func (*FakeIPTables) EnsureChain ¶ added in v0.0.8
EnsureChain is part of iptables.Interface
func (*FakeIPTables) EnsureRule ¶ added in v0.0.8
func (f *FakeIPTables) EnsureRule(position iptables.RulePosition, table iptables.Table, chain iptables.Chain, args ...string) (bool, error)
EnsureRule is part of iptables.Interface
func (*FakeIPTables) FlushChain ¶ added in v0.0.8
FlushChain is part of iptables.Interface
func (*FakeIPTables) HasRandomFully ¶ added in v0.0.8
func (f *FakeIPTables) HasRandomFully() bool
HasRandomFully is part of iptables.Interface
func (*FakeIPTables) IsIPv6 ¶ added in v0.0.8
func (f *FakeIPTables) IsIPv6() bool
IsIPv6 is part of iptables.Interface
func (*FakeIPTables) Monitor ¶ added in v0.0.8
func (f *FakeIPTables) Monitor(canary iptables.Chain, tables []iptables.Table, reloadFunc func(), interval time.Duration, stopCh <-chan struct{})
Monitor is part of iptables.Interface
func (*FakeIPTables) Present ¶ added in v0.0.8
func (f *FakeIPTables) Present() bool
func (*FakeIPTables) Protocol ¶ added in v0.0.8
func (f *FakeIPTables) Protocol() iptables.Protocol
Protocol is part of iptables.Interface
func (*FakeIPTables) Restore ¶ added in v0.0.8
func (f *FakeIPTables) Restore(table iptables.Table, data []byte, flush iptables.FlushFlag, counters iptables.RestoreCountersFlag) error
Restore is part of iptables.Interface copied from k8s.io/kubernetes/pkg/util/iptables/testing/fake.go
func (*FakeIPTables) RestoreAll ¶ added in v0.0.8
func (f *FakeIPTables) RestoreAll(data []byte, flush iptables.FlushFlag, counters iptables.RestoreCountersFlag) error
RestoreAll is part of iptables.Interface copied from k8s.io/kubernetes/pkg/util/iptables/testing/fake.go
func (*FakeIPTables) SetHasRandomFully ¶ added in v0.0.8
func (f *FakeIPTables) SetHasRandomFully(can bool) *FakeIPTables
SetHasRandomFully sets f's return value for HasRandomFully()
type Interface ¶
func NewIPTables ¶
func NewIPTables() Interface
type IpTables ¶
type IpTables interface { // ApendUnique appends given rulespec if not exists AppendUnique(table, chain string, rulespec ...string) error // Exists checks if given rulespec in specified table/chain exists Exists(table, chain string, rulespec ...string) (bool, error) // Insert inserts given rulespec to specified table/chain at specified position Insert(table, chain string, pos int, rulespec ...string) error // Delete removes rulespec in specified table/chain Delete(table, chain string, rulespec ...string) error // List lists rules in specified table/chain List(table, chain string) ([]string, error) }
Directories ¶
Path | Synopsis |
---|---|
Package mockiptableswrapper is a generated GoMock package.
|
Package mockiptableswrapper is a generated GoMock package. |