Documentation
¶
Index ¶
- Constants
- Variables
- func FilterBatchErrors(err error, mode Mode, cmds []string) error
- func GetOwnIPs() []net.IP
- func GetOwnNetworkInterfaces() []string
- func IpToNet(ips []net.IP) []net.IPNet
- func ParseBatchError(cmd []string, r io.Reader) error
- func Resolve(ctx context.Context, ipOrHostnames ...string) ([]net.IP, error)
- func ToReader(strs []string) io.Reader
- type BatchError
- type BatchErrors
- type BlackholeOpts
- type CommandDigRunner
- type CorruptPackagesOpts
- type DelayOpts
- type DigRunner
- type Family
- type Filter
- type HostnameResolver
- type LimitBandwidthOpts
- type Mode
- type NetWithPortRange
- type Opts
- type PackageLossOpts
- type PortRange
Constants ¶
View Source
const ( ModeAdd Mode = "add" ModeDelete Mode = "del" FamilyV4 Family = "inet" FamilyV6 Family = "inet6" )
Variables ¶
View Source
var ( NetAny = []net.IPNet{ {IP: net.IPv4zero, Mask: net.CIDRMask(0, 32)}, {IP: net.IPv6zero, Mask: net.CIDRMask(0, 128)}, } )
View Source
var (
PortRangeAny = PortRange{From: 1, To: 65534}
)
Functions ¶
func FilterBatchErrors ¶ added in v1.0.7
func GetOwnNetworkInterfaces ¶
func GetOwnNetworkInterfaces() []string
Types ¶
type BatchError ¶ added in v1.0.7
func (*BatchError) Error ¶ added in v1.0.7
func (t *BatchError) Error() string
type BatchErrors ¶ added in v1.0.7
type BatchErrors struct {
Cmd []string
Errors []BatchError
}
func (*BatchErrors) Error ¶ added in v1.0.7
func (t *BatchErrors) Error() string
type BlackholeOpts ¶
type BlackholeOpts struct {
Filter
}
func (*BlackholeOpts) IpCommands ¶
func (o *BlackholeOpts) IpCommands(family Family, mode Mode) ([]string, error)
func (*BlackholeOpts) String ¶
func (o *BlackholeOpts) String() string
func (*BlackholeOpts) TcCommands ¶
func (o *BlackholeOpts) TcCommands(_ Mode) ([]string, error)
type CommandDigRunner ¶ added in v1.0.4
type CommandDigRunner struct {
}
type CorruptPackagesOpts ¶
func (*CorruptPackagesOpts) IpCommands ¶
func (o *CorruptPackagesOpts) IpCommands(_ Family, _ Mode) ([]string, error)
func (*CorruptPackagesOpts) String ¶
func (o *CorruptPackagesOpts) String() string
func (*CorruptPackagesOpts) TcCommands ¶
func (o *CorruptPackagesOpts) TcCommands(mode Mode) ([]string, error)
type Filter ¶
type Filter struct {
Include []NetWithPortRange
Exclude []NetWithPortRange
}
type HostnameResolver ¶ added in v1.0.4
type HostnameResolver struct {
Dig DigRunner
}
type LimitBandwidthOpts ¶
func (*LimitBandwidthOpts) IpCommands ¶
func (o *LimitBandwidthOpts) IpCommands(_ Family, _ Mode) ([]string, error)
func (*LimitBandwidthOpts) String ¶
func (o *LimitBandwidthOpts) String() string
func (*LimitBandwidthOpts) TcCommands ¶
func (o *LimitBandwidthOpts) TcCommands(mode Mode) ([]string, error)
type NetWithPortRange ¶
func NewNetWithPortRanges ¶
func NewNetWithPortRanges(nets []net.IPNet, portRanges ...PortRange) []NetWithPortRange
func (NetWithPortRange) Equal ¶ added in v1.0.5
func (nwp NetWithPortRange) Equal(o NetWithPortRange) bool
func (NetWithPortRange) String ¶
func (nwp NetWithPortRange) String() string
type PackageLossOpts ¶
func (*PackageLossOpts) IpCommands ¶
func (o *PackageLossOpts) IpCommands(_ Family, _ Mode) ([]string, error)
func (*PackageLossOpts) String ¶
func (o *PackageLossOpts) String() string
func (*PackageLossOpts) TcCommands ¶
func (o *PackageLossOpts) TcCommands(mode Mode) ([]string, error)
Click to show internal directories.
Click to hide internal directories.