conntest

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Mar 6, 2018 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 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.

func (*MockConnection) Read

func (c *MockConnection) Read(ctx context.Context, responseTo int32) (msg.Response, error)

Read reads a server response from the MockConnection.

func (*MockConnection) Write

func (c *MockConnection) Write(ctx context.Context, reqs ...msg.Request) error

Write writes a wire protocol message to MockConnection.

Jump to

Keyboard shortcuts

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