transptest

package
v6.0.1+incompatible Latest Latest
Warning

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

Go to latest
Published: Dec 2, 2017 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GenCertsForIPIfMIssing

func GenCertsForIPIfMIssing(
	t *testing.T,
	ip net.IP,
	name string,
) error

genCertsIfMIssing generates a testing certificate for ip 127.0.0.1 for testing if certificate or key is missing. Generated is used for CA, client-auth and server-auth. Use only for testing.

Types

type MockServer

type MockServer struct {
	net.Listener
	Timeout   time.Duration
	Err       error
	Handshake func(net.Conn)
	Transp    func() (*transport.Client, error)
}

func NewMockServerTCP

func NewMockServerTCP(t *testing.T, to time.Duration, cert string, proxy *transport.ProxyConfig) *MockServer

func NewMockServerTLS

func NewMockServerTLS(t *testing.T, to time.Duration, cert string, proxy *transport.ProxyConfig) *MockServer

func (*MockServer) Accept

func (m *MockServer) Accept() net.Conn

func (*MockServer) Addr

func (m *MockServer) Addr() string

func (*MockServer) Await

func (m *MockServer) Await() chan net.Conn

func (*MockServer) ClientDeadline

func (m *MockServer) ClientDeadline(client net.Conn, to time.Duration)

func (*MockServer) Connect

func (m *MockServer) Connect() (*transport.Client, error)

func (*MockServer) ConnectPair

func (m *MockServer) ConnectPair() (net.Conn, *transport.Client, error)

type MockServerFactory

type MockServerFactory func(*testing.T, time.Duration, string, *transport.ProxyConfig) *MockServer

type TransportFactory

type TransportFactory func(addr string, proxy *transport.ProxyConfig) (*transport.Client, error)

Jump to

Keyboard shortcuts

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