llano

package module
v0.0.0-...-84df3fa Latest Latest
Warning

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

Go to latest
Published: Jun 10, 2014 License: MIT Imports: 3 Imported by: 1

README

llano

Build Status

GoDoc

The llano pocket gopher.

Llano is a mock server, useful when testing other libraries during development.

See godoc for library usage.

To install the binary
go get github.com/MindTwister/llano/llano
Example usage
llano -http=":2020" -body="OK"
Command line flags

-http string the address on which to listen, default: 127.0.0.1:2020

-body string Response for /200 default: OK

Documentation

Overview

Llano is a mock server, useful when testing other libraries during development.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Code200

func Code200(standardResponse string) http.HandlerFunc

Returns a http.HandlerFunc that always respons with 200: standardResponse

func Code301

func Code301(to string) http.HandlerFunc

More or less a wrapper around http.Redirect (http://golang.org/pkg/net/http/#Redirect)

func Code302

func Code302(to string) http.HandlerFunc

More or less a wrapper around http.Redirect (http://golang.org/pkg/net/http/#Redirect)

func Code500

func Code500() http.HandlerFunc

Guess, always returns 500

func Echo

func Echo(w http.ResponseWriter, r *http.Request)

Returns the request body with the original Content-Type forwarded

func Standalone

func Standalone(address, default200 string)

Standalone llano server, listens for all http.Handlers specified in the package with their response code as url (/200, /301) (echo for... echo)

func Timeout

func Timeout(w http.ResponseWriter, r *http.Request)

Holds the connection for indefinite time

Types

This section is empty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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