handlerutil

package
v1.11.3 Latest Latest
Warning

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

Go to latest
Published: Sep 1, 2020 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ErrorCode

func ErrorCode(err error) int

ErrorCode returns the int representing an error.

func ErrorCodeWithDefault

func ErrorCodeWithDefault(err error, defaultCode int) int

ErrorCodeWithDefault returns the int representing an error with a default value.

func ParseAndGetChart added in v1.8.0

func ParseAndGetChart(req *http.Request, cu chartUtils.Resolver, requireV1Support bool) (*chartUtils.Details, *chartUtils.ChartMultiVersion, error)

ParseAndGetChart request and parse a chart.

func QueryParamIsTruthy added in v1.8.0

func QueryParamIsTruthy(param string, req *http.Request) bool

Types

type Params

type Params map[string]string

Params a key-value map of path params

type WithParams

type WithParams func(http.ResponseWriter, *http.Request, Params)

WithParams can be used to wrap handlers to take an extra arg for path params

func (WithParams) ServeHTTP

func (h WithParams) ServeHTTP(w http.ResponseWriter, req *http.Request)

type WithoutParams

type WithoutParams func(http.ResponseWriter, *http.Request)

WithoutParams can be used to wrap handlers that doesn't take params

func (WithoutParams) ServeHTTP

func (h WithoutParams) ServeHTTP(w http.ResponseWriter, req *http.Request)

Jump to

Keyboard shortcuts

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