httphelpers

package
v0.0.0-...-affaa53 Latest Latest
Warning

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

Go to latest
Published: Jun 28, 2019 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Respond

func Respond(w http.ResponseWriter, statusCode int)

func RespondWithBody

func RespondWithBody(w http.ResponseWriter, statusCode int, responseBody interface{})

func RespondWithError

func RespondWithError(w http.ResponseWriter, apperr apperrors.AppError)

func RespondWithErrorAndLog

func RespondWithErrorAndLog(w http.ResponseWriter, apperr apperrors.AppError)

func WithMiddlewares

func WithMiddlewares(router *mux.Router, middlewares ...mux.MiddlewareFunc)

WithMiddlewares decorates router with middlewares

Types

type WriterWithStatus

type WriterWithStatus struct {
	http.ResponseWriter
	// contains filtered or unexported fields
}

func (*WriterWithStatus) IsSuccessful

func (w *WriterWithStatus) IsSuccessful() bool

func (*WriterWithStatus) WriteHeader

func (w *WriterWithStatus) WriteHeader(statusCode int)

Jump to

Keyboard shortcuts

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