test_util

package
v0.0.0-...-eb0d769 Latest Latest
Warning

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

Go to latest
Published: Aug 5, 2014 License: Apache-2.0, BSD-2-Clause-Views, BSD-3-Clause, + 1 more Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewResponse

func NewResponse(status int) *http.Response

func NextAvailPort

func NextAvailPort() uint16

func SpecConfig

func SpecConfig(natsPort, statusPort, proxyPort uint16) *config.Config

Types

type FakeFile

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

func (*FakeFile) Read

func (f *FakeFile) Read(data *[]byte) (int, error)

func (*FakeFile) Write

func (f *FakeFile) Write(data []byte) (int, error)

type HttpConn

type HttpConn struct {
	net.Conn

	Reader *bufio.Reader
	Writer *bufio.Writer
}

func NewHttpConn

func NewHttpConn(x net.Conn) *HttpConn

func (*HttpConn) CheckLine

func (x *HttpConn) CheckLine(expected string)

func (*HttpConn) CheckLines

func (x *HttpConn) CheckLines(expected []string)

func (*HttpConn) NewRequest

func (x *HttpConn) NewRequest(method, urlStr string, body io.Reader) *http.Request

func (*HttpConn) ReadRequest

func (x *HttpConn) ReadRequest() (*http.Request, string)

func (*HttpConn) ReadResponse

func (x *HttpConn) ReadResponse() (*http.Response, string)

func (*HttpConn) WriteLine

func (x *HttpConn) WriteLine(line string)

func (*HttpConn) WriteLines

func (x *HttpConn) WriteLines(lines []string)

func (*HttpConn) WriteRequest

func (x *HttpConn) WriteRequest(req *http.Request)

func (*HttpConn) WriteResponse

func (x *HttpConn) WriteResponse(resp *http.Response)

type Nats

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

func NewNats

func NewNats(port uint16) *Nats

func NewNatsOnRandomPort

func NewNatsOnRandomPort() *Nats

func (*Nats) Port

func (n *Nats) Port() uint16

func (*Nats) Start

func (n *Nats) Start()

func (*Nats) Stop

func (n *Nats) Stop()

Jump to

Keyboard shortcuts

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