transptest

package
v6.2.1+incompatible Latest Latest
Warning

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

Go to latest
Published: Feb 7, 2018 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GenCertForTestingPurpose

func GenCertForTestingPurpose(t *testing.T, host, name, keyPassword string) error

GenCertForTestingPurpose generates a testing certificate. 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