protocol

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Apr 12, 2023 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Overview

Package protocol implements the agent that injects disruptors in protocols. The protocol disruptors run as a proxy. The agent redirects the traffic to the proxy using iptables.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Disruptor

type Disruptor interface {
	Apply(duration time.Duration) error
}

Disruptor defines the interface agent

func NewDefaultDisruptor

func NewDefaultDisruptor(proxy Proxy) (Disruptor, error)

NewDefaultDisruptor creates a Disruptor with valid default configuration.

func NewDisruptor

func NewDisruptor(
	config DisruptorConfig,
	proxy Proxy,
) (Disruptor, error)

NewDisruptor creates a new instance of a Disruptor that applies a disruptions to a target The configuration controls how the disruptor operates.

type DisruptorConfig

type DisruptorConfig struct {
	// Destination port to intercept protocol
	TargetPort uint
	// Network interface where the traffic will be intercepted
	Iface string
	// Port to redirect protocol to
	RedirectPort uint
}

DisruptorConfig defines the configuration options for the Disruptor

type Proxy

type Proxy interface {
	Start() error
	Stop() error
	Force() error
}

Proxy defines an interface for a proxy

Directories

Path Synopsis
Package grpc implements a proxy that applies disruptions to gRPC requests This package is inspired by and extensively copies code from https://github.com/mwitkow/grpc-proxy
Package grpc implements a proxy that applies disruptions to gRPC requests This package is inspired by and extensively copies code from https://github.com/mwitkow/grpc-proxy
Package http implements a proxy that applies disruptions to HTTP requests
Package http implements a proxy that applies disruptions to HTTP requests

Jump to

Keyboard shortcuts

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