netrans

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Apr 28, 2024 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrReadTimeout = errors.New("read timeout")
View Source
var ErrReaderClosed = errors.New("reader has been closed")

Functions

func MultiReadCloser

func MultiReadCloser(rcs ...io.ReadCloser) io.ReadCloser

func NewChannelReader

func NewChannelReader(ch chan []byte) io.Reader

func NewChannelWriteCloser

func NewChannelWriteCloser(ctx context.Context) (chan []byte, io.WriteCloser)

func NewTimeoutConn added in v1.0.0

func NewTimeoutConn(conn net.Conn, readTimeout, writeTimeout time.Duration) net.Conn

func NewTimeoutReadCloser

func NewTimeoutReadCloser(ctx context.Context, rc io.ReadCloser, timeout time.Duration) io.ReadCloser

func NewTimeoutReader

func NewTimeoutReader(ctx context.Context, r io.Reader, timeout time.Duration) io.Reader

Types

type DataFrame

type DataFrame struct {
	Length uint32
	Obs    byte
	Data   []byte
}

func NewDataFrame

func NewDataFrame(data []byte) *DataFrame

func ReadFrame

func ReadFrame(r io.Reader) (*DataFrame, error)

func (*DataFrame) MarshalBinary

func (d *DataFrame) MarshalBinary() []byte

type TimeoutConn added in v1.0.0

type TimeoutConn struct {
	net.Conn
	// contains filtered or unexported fields
}

func (*TimeoutConn) Read added in v1.0.0

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

func (*TimeoutConn) Write added in v1.0.0

func (c *TimeoutConn) Write(b []byte) (n int, err error)

type TimeoutReader

type TimeoutReader struct {
	// contains filtered or unexported fields
}

func (*TimeoutReader) Close

func (r *TimeoutReader) Close() error

func (*TimeoutReader) Read

func (r *TimeoutReader) Read(b []byte) (int, error)

Jump to

Keyboard shortcuts

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