Documentation ¶
Index ¶
- type MockConn
- func (mc *MockConn) Close() error
- func (mc *MockConn) IsClosed() bool
- func (mc *MockConn) LocalAddr() net.Addr
- func (mc *MockConn) Read(b []byte) (n int, err error)
- func (mc *MockConn) ReadBytes() []byte
- func (mc *MockConn) ReadElements() []xml.Element
- func (mc *MockConn) RemoteAddr() net.Addr
- func (mc *MockConn) SendBytes(b []byte)
- func (mc *MockConn) SendElement(elem xml.Element)
- func (mc *MockConn) SetDeadline(t time.Time) error
- func (mc *MockConn) SetReadDeadline(t time.Time) error
- func (mc *MockConn) SetWriteDeadline(t time.Time) error
- func (mc *MockConn) WaitClose()
- func (mc *MockConn) WaitCloseWithTimeout(timeout time.Duration)
- func (mc *MockConn) Write(b []byte) (n int, err error)
- type MockTransport
- func (mt *MockTransport) ChannelBindingBytes(config.ChannelBindingMechanism) []byte
- func (mt *MockTransport) Close() error
- func (mt *MockTransport) EnableCompression(level config.CompressionLevel)
- func (mt *MockTransport) GetWrittenBytes() []byte
- func (mt *MockTransport) IsClosed() bool
- func (mt *MockTransport) IsCompressed() bool
- func (mt *MockTransport) IsSecured() bool
- func (mt *MockTransport) Read(p []byte) (n int, err error)
- func (mt *MockTransport) SetChannelBindingBytes(cBindingBytes []byte)
- func (mt *MockTransport) SetReadBytes(p []byte)
- func (mt *MockTransport) StartTLS(tlsCfg *tls.Config)
- func (mt *MockTransport) Write(p []byte) (n int, err error)
- type Transport
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type MockConn ¶
type MockConn struct {
// contains filtered or unexported fields
}
MockConn represents a net.Conn mocked implementation.
func NewMockConn ¶
func NewMockConn() *MockConn
NewMockConn returns a new initialized MockConn instance.
func (*MockConn) ReadElements ¶
ReadElements deserializes previous write operation content into an XML elements array.
func (*MockConn) RemoteAddr ¶
RemoteAddr returns a mocked remote address.
func (*MockConn) SendElement ¶
SendElement sets next read operation content from a serialized XML element.
func (*MockConn) SetDeadline ¶
SetDeadline satisfies net.Conn interface.
func (*MockConn) SetReadDeadline ¶
SetReadDeadline satisfies net.Conn interface.
func (*MockConn) SetWriteDeadline ¶
SetWriteDeadline satisfies net.Conn interface.
func (*MockConn) WaitClose ¶
func (mc *MockConn) WaitClose()
WaitClose expects until the mocked connection closes.
func (*MockConn) WaitCloseWithTimeout ¶
WaitCloseWithTimeout expects until the mocked connection closes or until a timeout fires.
type MockTransport ¶
type MockTransport struct {
// contains filtered or unexported fields
}
MockTransport represents a mocked transport type.
func NewMockTransport ¶
func NewMockTransport() *MockTransport
NewMockTransport returns a new MockTransport instance.
func (*MockTransport) ChannelBindingBytes ¶
func (mt *MockTransport) ChannelBindingBytes(config.ChannelBindingMechanism) []byte
ChannelBindingBytes returns mocked transport channel binding bytes.
func (*MockTransport) Close ¶
func (mt *MockTransport) Close() error
Close marks a mocked transport as closed.
func (*MockTransport) EnableCompression ¶
func (mt *MockTransport) EnableCompression(level config.CompressionLevel)
EnableCompression marks a mocked transport as compressed.
func (*MockTransport) GetWrittenBytes ¶
func (mt *MockTransport) GetWrittenBytes() []byte
GetWrittenBytes returns transport previously written bytes.
func (*MockTransport) IsClosed ¶
func (mt *MockTransport) IsClosed() bool
IsClosed returns whether or not the mocked transport has been previously closed.
func (*MockTransport) IsCompressed ¶
func (mt *MockTransport) IsCompressed() bool
IsCompressed returns whether or not the mocked transport has been previously compressed.
func (*MockTransport) IsSecured ¶
func (mt *MockTransport) IsSecured() bool
IsSecured returns whether or not the mocked transport has been previously secured.
func (*MockTransport) Read ¶
func (mt *MockTransport) Read(p []byte) (n int, err error)
Read reads a byte array from the mocked transport.
func (*MockTransport) SetChannelBindingBytes ¶
func (mt *MockTransport) SetChannelBindingBytes(cBindingBytes []byte)
SetChannelBindingBytes sets mocked transport channel binding bytes.
func (*MockTransport) SetReadBytes ¶
func (mt *MockTransport) SetReadBytes(p []byte)
SetReadBytes sets transport next read operation result.
func (*MockTransport) StartTLS ¶
func (mt *MockTransport) StartTLS(tlsCfg *tls.Config)
StartTLS secures the mocked transport.
type Transport ¶
type Transport interface { io.ReadWriteCloser // StartTLS secures the transport using SSL/TLS StartTLS(*tls.Config) // EnableCompression activates a compression // mechanism on the transport. EnableCompression(config.CompressionLevel) // ChannelBindingBytes returns current transport // channel binding bytes. ChannelBindingBytes(config.ChannelBindingMechanism) []byte }
Transport represents a stream transport mechanism.