Documentation
¶
Index ¶
- Constants
- Variables
- func GetRunners() []string
- func Run(runnerName string) error
- type DockerNetwork
- type DockerReactor
- type Instance
- type InstanceHandler
- type K8sNetwork
- type K8sReactor
- type NetlinkLink
- func (l *NetlinkLink) AddrAdd(ip *net.IPNet) error
- func (l *NetlinkLink) AddrDel(ip *net.IPNet) error
- func (l *NetlinkLink) Down() error
- func (l *NetlinkLink) ListV4() ([]*net.IPNet, error)
- func (l *NetlinkLink) ListV6() ([]*net.IPNet, error)
- func (l *NetlinkLink) Shape(shape sync.LinkShape) error
- func (l *NetlinkLink) Up() error
- type Network
- type Reactor
Constants ¶
const (
EnvRedisHost = "REDIS_HOST"
)
Variables ¶
var PublicAddr = net.ParseIP("1.1.1.1")
PublicAddr points to an IP address in the public range. It helps us discover the IP address of the gateway (i.e. the Docker host) on the control network (the learned route will be via the control network because, at this point, the only network that's attached to the container is the control network).
Sidecar doesn't whitelist traffic to public addresses, but it special-cases traffic between the container and the host, so that pprof, metrics and other ports can be exposed to the Docker host.
Functions ¶
Types ¶
type DockerNetwork ¶
type DockerNetwork struct {
// contains filtered or unexported fields
}
func (*DockerNetwork) Close ¶
func (dn *DockerNetwork) Close() error
func (*DockerNetwork) ConfigureNetwork ¶
func (dn *DockerNetwork) ConfigureNetwork(ctx context.Context, cfg *sync.NetworkConfig) error
func (*DockerNetwork) ListActive ¶
func (dn *DockerNetwork) ListActive() []string
func (*DockerNetwork) ListAvailable ¶
func (dn *DockerNetwork) ListAvailable() []string
type DockerReactor ¶ added in v0.3.0
type DockerReactor struct {
// contains filtered or unexported fields
}
func (*DockerReactor) Close ¶ added in v0.3.0
func (d *DockerReactor) Close() error
func (*DockerReactor) Handle ¶ added in v0.3.0
func (d *DockerReactor) Handle(globalctx context.Context, handler InstanceHandler) error
type Instance ¶
type Instance struct { logging.Logging Hostname string Watcher *sync.Watcher Writer *sync.Writer RunEnv *runtime.RunEnv Network Network }
Instance is a test instance as seen by the sidecar.
type K8sNetwork ¶
type K8sNetwork struct {
// contains filtered or unexported fields
}
func (*K8sNetwork) Close ¶
func (n *K8sNetwork) Close() error
func (*K8sNetwork) ConfigureNetwork ¶
func (n *K8sNetwork) ConfigureNetwork(ctx context.Context, cfg *sync.NetworkConfig) error
func (*K8sNetwork) ListActive ¶
func (n *K8sNetwork) ListActive() []string
type K8sReactor ¶ added in v0.3.0
type K8sReactor struct {
// contains filtered or unexported fields
}
func (*K8sReactor) Close ¶ added in v0.3.0
func (d *K8sReactor) Close() error
func (*K8sReactor) Handle ¶ added in v0.3.0
func (d *K8sReactor) Handle(ctx context.Context, handler InstanceHandler) error
type NetlinkLink ¶
NetlinkLink abstracts operations over a network interface.
NetlinkLink shapes the egress traffic on the link using TC. To do so, it configures the following TC tree:
[________HTB Qdisc_________] - root 0 | 1 | n | ... - queue; 0 is the default. [HTB Class] - bandwidth (rate limiting) | [Netem Qdisc] - latency, jitter, etc. (per-packet attributes)
At the moment, only one queue is supported. When support for multiple subnets is added, additional classes/queues will be added per-subnet.
NetlinkLink also supports setting the network device up/down and changing the IP address.
NOTE: Not all run environments will react well to the IP address changing. Don't use this feature with docker.
func NewNetlinkLink ¶
NewNetlinkLink constructs a new netlink link handle.
func (*NetlinkLink) AddrAdd ¶
func (l *NetlinkLink) AddrAdd(ip *net.IPNet) error
AddrAdd adds an address to the link.
NOTE: This won't work in docker; use docker connect/disconnect.
func (*NetlinkLink) AddrDel ¶
func (l *NetlinkLink) AddrDel(ip *net.IPNet) error
AddrDel removes an address from the link.
NOTE: This won't work in docker; use docker connect/disconnect.
func (*NetlinkLink) ListV4 ¶
func (l *NetlinkLink) ListV4() ([]*net.IPNet, error)
ListV4 lists all IPv4 addresses associated with the link.
func (*NetlinkLink) ListV6 ¶
func (l *NetlinkLink) ListV6() ([]*net.IPNet, error)
ListV6 lists all IPv6 addresses associated with the link.