Documentation ¶
Index ¶
- type MockConnection
- func (c *MockConnection) Alive() bool
- func (c *MockConnection) Close() error
- func (c *MockConnection) CloseIgnoreError()
- func (c *MockConnection) Expired() bool
- func (c *MockConnection) LocalAddr() net.Addr
- func (c *MockConnection) MarkDead()
- func (c *MockConnection) Model() *model.Conn
- func (c *MockConnection) Read(ctx context.Context, responseTo int32) (msg.Response, error)
- func (c *MockConnection) Write(ctx context.Context, reqs ...msg.Request) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type MockConnection ¶
type MockConnection struct { Dead bool Sent []msg.Request ResponseQ []*msg.Reply ReadErr error WriteErr error SkipResponseToFixup bool }
MockConnection is used to mock a connection for testing purposes.
func (*MockConnection) Alive ¶
func (c *MockConnection) Alive() bool
Alive returns whether a MockConnection is alive.
func (*MockConnection) Close ¶
func (c *MockConnection) Close() error
Close closes a MockConnection.
func (*MockConnection) CloseIgnoreError ¶
func (c *MockConnection) CloseIgnoreError()
CloseIgnoreError closes a MockConnection and ignores any error that occurs.
func (*MockConnection) Expired ¶
func (c *MockConnection) Expired() bool
Expired returns whether a MockConnection is expired.
func (*MockConnection) LocalAddr ¶
func (c *MockConnection) LocalAddr() net.Addr
LocalAddr returns nil.
func (*MockConnection) MarkDead ¶
func (c *MockConnection) MarkDead()
MarkDead marks a MockConnection as dead.
func (*MockConnection) Model ¶
func (c *MockConnection) Model() *model.Conn
Model returns the description of a MockConnection.
Click to show internal directories.
Click to hide internal directories.