helper

package
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: Jan 20, 2017 License: MIT Imports: 19 Imported by: 0

Documentation

Index

Constants

View Source
const NginxResponseBufferHeader = "X-Accel-Buffering"

Variables

This section is empty.

Functions

func AllowResponseBuffering added in v1.1.0

func AllowResponseBuffering(w http.ResponseWriter)

func CleanHeadersForRaven added in v0.8.3

func CleanHeadersForRaven(r *http.Request)

func CleanUpProcessGroup added in v0.6.1

func CleanUpProcessGroup(cmd *exec.Cmd)

func DisableResponseBuffering added in v1.1.0

func DisableResponseBuffering(w http.ResponseWriter)

func ExitStatus added in v0.6.1

func ExitStatus(err error) (int, bool)

func Fail500

func Fail500(w http.ResponseWriter, r *http.Request, err error)

func HTTPError

func HTTPError(w http.ResponseWriter, r *http.Request, error string, code int)

func HeaderClone added in v0.6.3

func HeaderClone(h http.Header) http.Header

func IsContentType added in v1.3.0

func IsContentType(expected, actual string) bool

func LogError

func LogError(r *http.Request, err error)

func OpenFile

func OpenFile(path string) (file *os.File, fi os.FileInfo, err error)

func ReadAllTempfile added in v1.3.0

func ReadAllTempfile(r io.Reader) (tempfile *os.File, err error)

func ServiceUnavailable added in v0.8.3

func ServiceUnavailable(w http.ResponseWriter, r *http.Request, err error)

func SetCustomResponseLogger added in v1.0.0

func SetCustomResponseLogger(writer io.Writer)

func SetForwardedFor added in v1.3.0

func SetForwardedFor(newHeaders *http.Header, originalRequest *http.Request)

func SetNoCacheHeaders

func SetNoCacheHeaders(header http.Header)

func TooManyRequests added in v0.8.3

func TooManyRequests(w http.ResponseWriter, r *http.Request, err error)

func URLMustParse

func URLMustParse(s string) *url.URL

Types

type LoggingResponseWriter

type LoggingResponseWriter interface {
	http.ResponseWriter

	Log(r *http.Request)
}

func NewLoggingResponseWriter

func NewLoggingResponseWriter(rw http.ResponseWriter) LoggingResponseWriter

Jump to

Keyboard shortcuts

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