network

package
v0.2.7 Latest Latest
Warning

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

Go to latest
Published: Apr 2, 2026 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Apply

func Apply(ctx context.Context, opts WinOpts) error

func CleanupQosPolicies

func CleanupQosPolicies()

func Revert

func Revert(ctx context.Context, opts WinOpts) error

Types

type BlackholeOpts

type BlackholeOpts struct {
	Filter
	Duration   time.Duration
	FilterFile string
}

func (*BlackholeOpts) QoSCommands

func (o *BlackholeOpts) QoSCommands(_ Mode) ([]string, error)

func (*BlackholeOpts) String

func (o *BlackholeOpts) String() string

func (*BlackholeOpts) WinDivertCommands

func (o *BlackholeOpts) WinDivertCommands(mode Mode) ([]string, error)

type CorruptPackagesOpts

type CorruptPackagesOpts struct {
	Filter
	Corruption uint
	Duration   time.Duration
	FilterFile string
}

func (*CorruptPackagesOpts) QoSCommands

func (o *CorruptPackagesOpts) QoSCommands(_ Mode) ([]string, error)

func (*CorruptPackagesOpts) String

func (o *CorruptPackagesOpts) String() string

func (*CorruptPackagesOpts) WinDivertCommands

func (o *CorruptPackagesOpts) WinDivertCommands(mode Mode) ([]string, error)

type DelayOpts

type DelayOpts struct {
	Filter
	Delay      time.Duration
	Duration   time.Duration
	Jitter     bool
	FilterFile string
}

func (*DelayOpts) QoSCommands

func (o *DelayOpts) QoSCommands(_ Mode) ([]string, error)

func (*DelayOpts) String

func (o *DelayOpts) String() string

func (*DelayOpts) WinDivertCommands

func (o *DelayOpts) WinDivertCommands(mode Mode) ([]string, error)

type Direction

type Direction string
var (
	DirectionIncoming Direction = "Incoming"
	DirectionOutgoing Direction = "Outgoing"
	DirectionAll      Direction = "All"
)

type Family

type Family string
const (
	FamilyV4 Family = "inet"
	FamilyV6 Family = "inet6"
)

type Filter

type Filter struct {
	Include          []akn.NetWithPortRange
	Exclude          []akn.NetWithPortRange
	InterfaceIndexes []int
	Direction        Direction
}

type LimitBandwidthOpts

type LimitBandwidthOpts struct {
	Bandwidth    string
	IncludeCidrs []net.IPNet
	PortRange    network.PortRange
}

func (*LimitBandwidthOpts) QoSCommands

func (o *LimitBandwidthOpts) QoSCommands(mode Mode) ([]string, error)

func (*LimitBandwidthOpts) String

func (o *LimitBandwidthOpts) String() string

func (*LimitBandwidthOpts) WinDivertCommands

func (o *LimitBandwidthOpts) WinDivertCommands(_ Mode) ([]string, error)

type Mode

type Mode string
const (
	ModeAdd    Mode = "add"
	ModeDelete Mode = "del"
)

type PackageLossOpts

type PackageLossOpts struct {
	Filter
	Loss     uint
	Duration time.Duration
	// contains filtered or unexported fields
}

func (*PackageLossOpts) QoSCommands

func (o *PackageLossOpts) QoSCommands(_ Mode) ([]string, error)

func (*PackageLossOpts) String

func (o *PackageLossOpts) String() string

func (*PackageLossOpts) WinDivertCommands

func (o *PackageLossOpts) WinDivertCommands(mode Mode) ([]string, error)

type WinOpts

type WinOpts interface {
	QoSCommands(mode Mode) ([]string, error)
	WinDivertCommands(mode Mode) ([]string, error)
	String() string
}

Jump to

Keyboard shortcuts

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