resttest

package
v0.0.0-...-7c10f35 Latest Latest
Warning

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

Go to latest
Published: Aug 4, 2015 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Server

type Server struct {
	*httptest.Server
	// contains filtered or unexported fields
}

Server is a light utility wrapper around httptest.Server which provides a useful RootedURL function.

func NewRootedServer

func NewRootedServer(root string, routes ...*rest.Route) *Server

NewRootedServer creates an httptest.Server that uses the given route as the REST handler rooted at the given path.

func NewRootedService

func NewRootedService(root string, service ...rest.Routable) *Server

NewRootedService creates an httptest.Server that uses the given service as the REST handler rooted at the given path.

func NewServer

func NewServer(routes ...*rest.Route) *Server

NewServer creates an httptest.Server that uses the given route as the REST handler.

func NewService

func NewService(service ...rest.Routable) *Server

NewService creates an httptest.Server that uses the given service as the REST handler.

func (*Server) RootedURL

func (server *Server) RootedURL() string

RootedURL returns the URL of the server plus the Root of the underlying rest.Mux.

Jump to

Keyboard shortcuts

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