mock

package
v0.1.14 Latest Latest
Warning

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

Go to latest
Published: Jul 22, 2015 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	READ_FAIL_ERROR  error = errors.New("copy failed on read")
	WRITE_FAIL_ERROR error = errors.New("copy failed on write")
	CLOSE_FAIL_ERROR error = errors.New("close file failed")
)

Functions

This section is empty.

Types

type HttpServer

type HttpServer struct {
	Mux    *http.ServeMux
	Server *httptest.Server
}

func (*HttpServer) Setup

func (s *HttpServer) Setup()

func (*HttpServer) Teardown

func (s *HttpServer) Teardown()

type MockReadWriteCloser

type MockReadWriteCloser struct {
	BytesRead    []byte
	BytesWritten []byte
	ReadErr      error
	WriteErr     error
	CloseErr     error
}

func NewReadWriteCloser

func NewReadWriteCloser(readErr, writeErr, closeErr error) *MockReadWriteCloser

func (*MockReadWriteCloser) Close

func (r *MockReadWriteCloser) Close() (err error)

func (*MockReadWriteCloser) Read

func (r *MockReadWriteCloser) Read(p []byte) (n int, err error)

func (*MockReadWriteCloser) Write

func (r *MockReadWriteCloser) Write(p []byte) (n int, err error)

Jump to

Keyboard shortcuts

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