http

package
v0.0.0-...-813fb4a Latest Latest
Warning

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

Go to latest
Published: Sep 8, 2014 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func WriteBadRequest

func WriteBadRequest(resp http.ResponseWriter, req *http.Request, msg ...string)

func WriteJSONErrorPage

func WriteJSONErrorPage(resp http.ResponseWriter, code int, message string)

func WriteJSONResponse

func WriteJSONResponse(resp http.ResponseWriter, code int, data interface{})

func WriteNoContent

func WriteNoContent(resp http.ResponseWriter)

func WriteNotFound

func WriteNotFound(resp http.ResponseWriter)

Types

type RequestLogger

type RequestLogger struct {
	Next http.Handler
}

func (*RequestLogger) ServeHTTP

func (l *RequestLogger) ServeHTTP(resp http.ResponseWriter, req *http.Request)

type ResponseRecorder

type ResponseRecorder struct {
	http.ResponseWriter

	StatusCode   int
	BytesWritten int64
}

func (*ResponseRecorder) Write

func (e *ResponseRecorder) Write(b []byte) (int, error)

Write sums the writes to produce the actual number of bytes written

func (*ResponseRecorder) WriteHeader

func (e *ResponseRecorder) WriteHeader(code int)

WriteHeader captures the status code and writes through to the wrapper ResponseWriter.

Directories

Path Synopsis
Provides a standard interface to start a net/http.Handler with a configurable http server.
Provides a standard interface to start a net/http.Handler with a configurable http server.

Jump to

Keyboard shortcuts

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