Documentation
¶
Index ¶
- func HostIP(host string) string
- func IsReachable(ctx context.Context, destNode string) bool
- type IPTables
- func (IPTables) Drop(ctx context.Context, node string, srcNode string) error
- func (IPTables) Fast(ctx context.Context, node string) error
- func (IPTables) Flaky(ctx context.Context, node string) error
- func (IPTables) Heal(ctx context.Context, node string) error
- func (IPTables) Slow(ctx context.Context, node string, opts SlowOptions) error
- type Net
- type Noop
- func (Noop) Drop(ctx context.Context, node string, srcNode string) error
- func (Noop) Fast(ctx context.Context, node string) error
- func (Noop) Flaky(ctx context.Context, node string) error
- func (Noop) Heal(ctx context.Context, node string) error
- func (Noop) Slow(ctx context.Context, node string, opts SlowOptions) error
- type SlowOptions
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type IPTables ¶
type IPTables struct {
Net
}
IPTables implements Net interface to simulate the network.
type Net ¶
type Net interface {
// Drop runs on the node and drops traffic from srcNode.
Drop(ctx context.Context, node string, srcNode string) error
// Heal runs on the node and ends all traffic drops and restores network to fast operations.
Heal(ctx context.Context, node string) error
// Slow runs on the node and delays the network packets with options.
Slow(ctx context.Context, node string, opts SlowOptions) error
// Flaky runs on the node and introduces randomized packet loss.
Flaky(ctx context.Context, node string) error
// Fast runs on the node and removes packet loss and delays.
Fast(ctx context.Context, node string) error
}
Net is used to control the network.
type Noop ¶
type Noop struct {
Net
}
Noop implements Net interface but does nothing.
type SlowOptions ¶
SlowOptions is used to delay the network packets.
func DefaultSlowOptions ¶
func DefaultSlowOptions() SlowOptions
DefaultSlowOptions returns a default options.
Click to show internal directories.
Click to hide internal directories.