testutils

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: Dec 22, 2014 License: Apache-2.0, Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GET

func GET(url string, o Opts) (*http.Response, []byte, error)

func MakeRequest

func MakeRequest(url string, opts Opts) (*http.Response, []byte, error)

func NewTestResponder

func NewTestResponder(response string) *httptest.Server

func NewTestServer

func NewTestServer(handler WebHandler) *httptest.Server

Types

type Opts

type Opts struct {
	Host    string
	Method  string
	Body    string
	Headers http.Header
}

type RndString

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

func NewRndString

func NewRndString() *RndString

func (*RndString) MakePath

func (s *RndString) MakePath(varlen, minlen int) string

func (*RndString) MakeString

func (r *RndString) MakeString(n int) string

func (*RndString) Read

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

type WebHandler

type WebHandler func(http.ResponseWriter, *http.Request)

Jump to

Keyboard shortcuts

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