testing

package
v0.0.3-pre4.0...-0ec3cfc Latest Latest
Warning

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

Go to latest
Published: Oct 21, 2020 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type LogFormatter

type LogFormatter struct{}

LogFormatter provides a log formatter for unit tests free of timestamps

func NewLogFormatter

func NewLogFormatter() *LogFormatter

NewLogFormatter creates a new log formatter

func (*LogFormatter) Format

func (l *LogFormatter) Format(e *logrus.Entry) ([]byte, error)

Format formats a log entry

type MockAddr

type MockAddr struct {
	Addr  string
	Proto string
}

func (*MockAddr) Network

func (ma *MockAddr) Network() string

func (*MockAddr) String

func (ma *MockAddr) String() string

type MockConn

type MockConn struct {
	net.Conn
	Buf    *bytes.Buffer
	Closed bool
}

MockConn mock an connection

func NewMockConn

func NewMockConn() *MockConn

func (*MockConn) Close

func (m *MockConn) Close() error

func (*MockConn) Read

func (m *MockConn) Read(b []byte) (n int, err error)

func (*MockConn) Write

func (m *MockConn) Write(b []byte) (int, error)

type MockConnBidi

type MockConnBidi struct {
	net.Conn
	BufA   *bytes.Buffer
	BufAMu sync.Mutex
	BufB   *bytes.Buffer
	BufBMu sync.Mutex
	AddrA  *MockAddr
	AddrB  *MockAddr
	Closed bool
}

MockConnBidi mock an connection

func NewMockConnBidi

func NewMockConnBidi(addrA, addrB *MockAddr) *MockConnBidi

func (*MockConnBidi) Close

func (m *MockConnBidi) Close() error

func (*MockConnBidi) LocalAddr

func (m *MockConnBidi) LocalAddr() net.Addr

func (*MockConnBidi) Read

func (m *MockConnBidi) Read(b []byte) (n int, err error)

func (*MockConnBidi) ReadA

func (m *MockConnBidi) ReadA(b []byte) (n int, err error)

func (*MockConnBidi) RemoteAddr

func (m *MockConnBidi) RemoteAddr() net.Addr

func (*MockConnBidi) Write

func (m *MockConnBidi) Write(b []byte) (int, error)

func (*MockConnBidi) WriteB

func (m *MockConnBidi) WriteB(b []byte) (int, error)

Jump to

Keyboard shortcuts

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