testutil

package
v1.1.0-beta.0...-a878e1f Latest Latest
Warning

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

Go to latest
Published: Dec 19, 2024 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetPortFromTCPAddr

func GetPortFromTCPAddr(addr net.Addr) uint

GetPortFromTCPAddr gets the port from a net.Addr.

Types

type BytesConn

type BytesConn struct {
	bytes.Buffer
}

BytesConn is a net.Conn implementation, which reads data from a bytes.Buffer.

func (*BytesConn) Close

func (*BytesConn) Close() error

Close implements the net.Conn interface.

func (*BytesConn) LocalAddr

func (*BytesConn) LocalAddr() net.Addr

LocalAddr implements the net.Conn interface.

func (*BytesConn) Read

func (c *BytesConn) Read(b []byte) (n int, err error)

Read implements the net.Conn interface.

func (*BytesConn) RemoteAddr

func (*BytesConn) RemoteAddr() net.Addr

RemoteAddr implements the net.Conn interface.

func (*BytesConn) SetDeadline

func (*BytesConn) SetDeadline(time.Time) error

SetDeadline implements the net.Conn interface.

func (*BytesConn) SetReadDeadline

func (*BytesConn) SetReadDeadline(time.Time) error

SetReadDeadline implements the net.Conn interface.

func (*BytesConn) SetWriteDeadline

func (*BytesConn) SetWriteDeadline(time.Time) error

SetWriteDeadline implements the net.Conn interface.

func (*BytesConn) Write

func (*BytesConn) Write([]byte) (n int, err error)

Write implements the net.Conn interface.

Jump to

Keyboard shortcuts

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