internal

package
v0.0.0-...-1aeb11e Latest Latest
Warning

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

Go to latest
Published: Aug 4, 2023 License: MIT Imports: 2 Imported by: 0

Documentation

Overview

Package internal contains mock objects for testing.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MockFrame

type MockFrame struct {
	Buf bytes.Buffer
}

MockFrame implements BinaryUnmarshaler.

func (*MockFrame) UnmarshalBinary

func (f *MockFrame) UnmarshalBinary(data []byte) error

UnmarshalBinary stores data into Buf.

type MockReader

type MockReader struct {
	Buf *bytes.Buffer

	DiscardCount int
	PeekCount    int
	ReadCount    int
	UnreadCount  int

	DiscardErr error
	PeekErr    error
	ReadErr    error
	UnreadErr  error
}

MockReader implements decoderReader.

func (*MockReader) Buffered

func (r *MockReader) Buffered() int

Buffered returns the number of bytes in Buf.

func (*MockReader) Discard

func (r *MockReader) Discard(n int) (int, error)

Discard the specified number of bytes from Buf.

func (*MockReader) Peek

func (r *MockReader) Peek(n int) ([]byte, error)

Peek returns the specified number of bytes from Buf without discarding.

func (*MockReader) ReadByte

func (r *MockReader) ReadByte() (byte, error)

ReadByte returns the next available byte from Buf.

func (*MockReader) UnreadByte

func (r *MockReader) UnreadByte() error

UnreadByte places the last read byte back into Buf.

Jump to

Keyboard shortcuts

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