Versions in this module Expand all Collapse all v1 v1.2.1 Jul 24, 2015 Changes in this version + var ErrProxyAlreadyStarted = errors.New("Proxy already started") + var Version = "1.2.1" + func NewServer(collection *ProxyCollection) *server + type BandwidthToxic struct + Enabled bool + Rate int64 + func (t *BandwidthToxic) IsEnabled() bool + func (t *BandwidthToxic) Name() string + func (t *BandwidthToxic) Pipe(stub *ToxicStub) + func (t *BandwidthToxic) SetEnabled(enabled bool) + type ChanReader struct + func NewChanReader(input <-chan *StreamChunk) *ChanReader + func (c *ChanReader) Read(out []byte) (int, error) + type ChanWriter struct + func NewChanWriter(output chan<- *StreamChunk) *ChanWriter + func (c *ChanWriter) Close() error + func (c *ChanWriter) Write(buf []byte) (int, error) + type ConnectionList struct + func (c *ConnectionList) Lock() + func (c *ConnectionList) Unlock() + type LatencyToxic struct + Enabled bool + Jitter int64 + Latency int64 + func (t *LatencyToxic) IsEnabled() bool + func (t *LatencyToxic) Name() string + func (t *LatencyToxic) Pipe(stub *ToxicStub) + func (t *LatencyToxic) SetEnabled(enabled bool) + type NoopToxic struct + func (t *NoopToxic) IsEnabled() bool + func (t *NoopToxic) Name() string + func (t *NoopToxic) Pipe(stub *ToxicStub) + func (t *NoopToxic) SetEnabled(enabled bool) + type Proxy struct + Enabled bool + Listen string + Name string + Upstream string + func NewProxy() *Proxy + func (proxy *Proxy) RemoveConnection(name string) + func (proxy *Proxy) Start() error + func (proxy *Proxy) Stop() + func (proxy *Proxy) Update(input *Proxy) error + type ProxyCollection struct + func NewProxyCollection() *ProxyCollection + func (collection *ProxyCollection) Add(proxy *Proxy, start bool) error + func (collection *ProxyCollection) Clear() error + func (collection *ProxyCollection) Get(name string) (*Proxy, error) + func (collection *ProxyCollection) Proxies() map[string]*Proxy + func (collection *ProxyCollection) Remove(name string) error + type SlicerToxic struct + AverageSize int + Delay int + Enabled bool + SizeVariation int + func (t *SlicerToxic) IsEnabled() bool + func (t *SlicerToxic) Name() string + func (t *SlicerToxic) Pipe(stub *ToxicStub) + func (t *SlicerToxic) SetEnabled(enabled bool) + type SlowCloseToxic struct + Delay int64 + Enabled bool + func (t *SlowCloseToxic) IsEnabled() bool + func (t *SlowCloseToxic) Name() string + func (t *SlowCloseToxic) Pipe(stub *ToxicStub) + func (t *SlowCloseToxic) SetEnabled(enabled bool) + type StreamChunk struct + type TimeoutToxic struct + Enabled bool + Timeout int64 + func (t *TimeoutToxic) IsEnabled() bool + func (t *TimeoutToxic) Name() string + func (t *TimeoutToxic) Pipe(stub *ToxicStub) + func (t *TimeoutToxic) SetEnabled(enabled bool) + type Toxic interface + IsEnabled func() bool + Name func() string + Pipe func(*ToxicStub) + SetEnabled func(bool) + type ToxicCollection struct + func NewToxicCollection(proxy *Proxy) *ToxicCollection + func (c *ToxicCollection) GetToxicMap() map[string]Toxic + func (c *ToxicCollection) RemoveLink(name string) + func (c *ToxicCollection) ResetToxics() + func (c *ToxicCollection) SetToxicJson(name string, data io.Reader) (Toxic, error) + func (c *ToxicCollection) SetToxicValue(toxic Toxic) error + func (c *ToxicCollection) StartLink(name string, input io.Reader, output io.WriteCloser) + type ToxicLink struct + func NewToxicLink(proxy *Proxy, toxics *ToxicCollection) *ToxicLink + func (link *ToxicLink) SetToxic(toxic Toxic, index int) + func (link *ToxicLink) Start(name string, source io.Reader, dest io.WriteCloser) + type ToxicStub struct + func NewToxicStub(input <-chan *StreamChunk, output chan<- *StreamChunk) *ToxicStub + func (s *ToxicStub) Close() + func (s *ToxicStub) Interrupt() bool + func (s *ToxicStub) Run(toxic Toxic) Incompatible versions in this module v2.1.4+incompatible Jan 10, 2019