mockwriter

package
v0.5.1 Latest Latest
Warning

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

Go to latest
Published: Nov 15, 2019 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrMockWriter = errors.New("naza.mockwriter: a mock error")
)

Functions

This section is empty.

Types

type MockWriter

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

func NewMockWriter

func NewMockWriter(t WriterType) *MockWriter

func (*MockWriter) SetSpecificType

func (w *MockWriter) SetSpecificType(ts map[uint32]WriterType)

为某些写操作指定特定的类型,次数从 0 开始计数

func (*MockWriter) Write

func (w *MockWriter) Write(b []byte) (int, error)

type WriterType

type WriterType uint8
const (
	WriterTypeDoNothing WriterType = iota
	WriterTypeReturnError
	WriterTypeIntoBuffer
)

Jump to

Keyboard shortcuts

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