httputil

package
v1.12.1 Latest Latest
Warning

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

Go to latest
Published: Mar 15, 2024 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 EncodeEmptyRequest added in v1.10.0

func EncodeEmptyRequest(c context.Context, r *http.Request, request 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