testutils

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

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

Go to latest
Published: Oct 12, 2017 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewTestHAProxyLogRecord

func NewTestHAProxyLogRecord(getUrl string) (*logger.HAProxyLogRecord, *httptest.ResponseRecorder)

func NewZkServer

func NewZkServer() (*zookeeper.Server, error)

Types

type Backend

type Backend struct {
	Server  *httptest.Server
	Handler *Handler
}

func NewBackend

func NewBackend(meanWaitMs int, powerLaw bool) *Backend

func (*Backend) Address

func (b *Backend) Address() string

func (*Backend) SetResponse

func (b *Backend) SetResponse(code int, body string)

func (*Backend) SetStatus

func (b *Backend) SetStatus(code int, header string)

func (*Backend) Shutdown

func (b *Backend) Shutdown()

func (*Backend) URL

func (b *Backend) URL() string

type Handler

type Handler struct {
	MeanWait int
	PowerLaw bool
	Response Response
	Status   Status
	Recorded *list.List
}

func NewHandler

func NewHandler(meanWaitMs int, powerLaw bool) *Handler

func (*Handler) ServeHTTP

func (h *Handler) ServeHTTP(w http.ResponseWriter, r *http.Request)

func (*Handler) Wait

func (h *Handler) Wait()

type RequestAndTime

type RequestAndTime struct {
	R http.Request
	T time.Time
}

type Response

type Response struct {
	Code int
	Body string
}

func (*Response) Set

func (r *Response) Set(code int, body string)

type Status

type Status struct {
	Code   int
	Header string
}

func (*Status) Set

func (s *Status) Set(code int, header string)

type ZkConn

type ZkConn struct {
	Conn *zookeeper.Conn
	// contains filtered or unexported fields
}

func NewZkConn

func NewZkConn(server *zookeeper.Server, panicOnReset bool) (*ZkConn, error)

func (*ZkConn) PanicOnReset

func (z *ZkConn) PanicOnReset()

Jump to

Keyboard shortcuts

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