fakeconn

package
v0.36.2 Latest Latest
Warning

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

Go to latest
Published: Jan 29, 2026 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FakeConn

type FakeConn struct {
	// Write an error to this channel to stop the Read consumer
	ReadCh chan ReaderOrErr

	// Consume messages written to this channel. The caller should Ack() to acknowledge receipt.
	WriteCh chan Msg

	Closed bool

	NextWriterError error
}

func NewFakeConn

func NewFakeConn() *FakeConn

func (*FakeConn) AssertClose

func (c *FakeConn) AssertClose(t *testing.T, done chan bool)

func (*FakeConn) AssertNextWriteMsg

func (c *FakeConn) AssertNextWriteMsg(t *testing.T) Msg

func (*FakeConn) Close

func (c *FakeConn) Close() error

func (*FakeConn) NewMessageToRead

func (c *FakeConn) NewMessageToRead(r io.Reader)

func (*FakeConn) NextReader

func (c *FakeConn) NextReader() (int, io.Reader, error)

func (*FakeConn) NextWriter

func (c *FakeConn) NextWriter(messagetype int) (io.WriteCloser, error)

type Msg

type Msg struct {
	Callback chan error
}

func (Msg) Ack

func (m Msg) Ack()

type ReaderOrErr

type ReaderOrErr struct {
	Reader io.Reader
	Err    error
}

Jump to

Keyboard shortcuts

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