mocks

package
v0.0.0-...-e5c7fd3 Latest Latest
Warning

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

Go to latest
Published: Sep 4, 2020 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	URL = "127.0.0.1:2500"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Addr

type Addr struct {
	NetworkString string
	AddrString    string
}

Addr is a fake network interface which implements the net.Addr interface

func (Addr) Network

func (a Addr) Network() string

func (Addr) String

func (a Addr) String() string

type Conn

type Conn struct {
	Server *End
	Client *End
}

MockConn facilitates testing by providing two connected ReadWriteClosers each of which can be used in place of a net.Conn

func NewConn

func NewConn() *Conn

func (*Conn) Close

func (c *Conn) Close() error

type End

type End struct {
	Reader *io.PipeReader
	Writer *io.PipeWriter
}

End is one 'end' of a simulated connection.

func (End) Close

func (e End) Close() error

func (End) LocalAddr

func (e End) LocalAddr() net.Addr

func (End) Read

func (e End) Read(data []byte) (n int, err error)

func (End) RemoteAddr

func (e End) RemoteAddr() net.Addr

func (End) SetDeadline

func (e End) SetDeadline(t time.Time) error

func (End) SetReadDeadline

func (e End) SetReadDeadline(t time.Time) error

func (End) SetWriteDeadline

func (e End) SetWriteDeadline(t time.Time) error

func (End) Write

func (e End) Write(data []byte) (n int, err error)

Jump to

Keyboard shortcuts

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