Documentation ¶
Overview ¶
Package peroxide provides some simple proxy-server-like functions to simplify testing reliable or redundant network services and bindings.
These projects have corner cases that are otherwise difficult to test as they involve bringing the service up/down at specific intervals in order to test the correct availability sequence. Peroxide makes this somewhat easier to accomplish, as you don't have to touch the running service; simply start/stop a proxy at will.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Conn ¶
type Conn interface {
Close()
}
Conn is an interface implemented by all proxied connections.
type Listener ¶
type Listener interface { // AcceptOne tells the Listener to accept another connection for proxying. It returns the // address on which it is expecting to accept that connection, and a channel on which it // will send the resulting Conn object once the connection is established. AcceptOne() (net.Addr, <-chan Conn) Close() }
Listener is an interface for connection-oriented protocols like TCP.
type TCPListener ¶
type TCPListener struct {
// contains filtered or unexported fields
}
TCPListener implements the Listener interface for the TCP protocol.
func NewTCPListener ¶
func NewTCPListener(t TestingT, listenAddr, dstAddr string) *TCPListener
NewTCPListener returns a new TCPListener for proxying connections between listenAddr and dstAddr.
func (*TCPListener) AcceptOne ¶
func (l *TCPListener) AcceptOne() (net.Addr, <-chan Conn)
AcceptOne implements the Listener AcceptOne method.
func (*TCPListener) Close ¶
func (l *TCPListener) Close()
Close implements the Listener Close method.