testutil

package
v0.4.1 Latest Latest
Warning

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

Go to latest
Published: Mar 11, 2016 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// TestAPIWithRealHTTPServer is a flag to switch the use of httptest.server.
	// If this flag is true, all tests will be executed with a real HTTP server.
	// If it is false, a server will not be created and tests are done by directly
	// calling ServeHTTP of a handler.
	TestAPIWithRealHTTPServer = false
)

Functions

func JScan

func JScan(js interface{}, path string) interface{}

JScan traverses a json object tree.

Types

type Server

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

Server is a temporary HTTP server for test.

func NewServer

func NewServer() *Server

NewServer returns a temporary running server.

func (*Server) Close

func (s *Server) Close()

Close closes the server.

func (*Server) HTTPClient

func (s *Server) HTTPClient() *http.Client

HTTPClient returns the HTTP client to send requests to the server.

func (*Server) URL

func (s *Server) URL() string

URL returns the URL of the server.

Jump to

Keyboard shortcuts

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