httputil

package
v1.9.0-beta Latest Latest
Warning

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

Go to latest
Published: Oct 17, 2021 License: MIT Imports: 12 Imported by: 13

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CopyURL

func CopyURL(base *url.URL, appendPath string) *url.URL

func DecodeJSONRequest

func DecodeJSONRequest(r *http.Request, into interface{}) error

func DecodeJSONResponse

func DecodeJSONResponse(r *http.Response, into interface{}) error

func EncodeJSONResponse

func EncodeJSONResponse(ctx context.Context, w http.ResponseWriter, response interface{}) error

func ErrorEncoder

func ErrorEncoder(_ context.Context, err error, w http.ResponseWriter)

func JSONErrorDecoder

func JSONErrorDecoder(r *http.Response) error

func NewRouter

func NewRouter(logger log.Logger) (*mux.Router, []httptransport.ServerOption)

func RequireBasicAuth added in v1.5.0

func RequireBasicAuth(h http.HandlerFunc, username, password, realm string) http.HandlerFunc

Types

This section is empty.

Jump to

Keyboard shortcuts

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