Documentation ¶
Index ¶
- Variables
- func NewClientTrace(ctx context.Context, tr tracer.Tracer) *httptrace.ClientTrace
- func NewRoundTripper(opts ...Option) http.RoundTripper
- func RegisterMethod(method string) error
- func RequestToContext(r *http.Request) context.Context
- func Write(w http.ResponseWriter, contentType string, status int, body string)
- func WriteBadRequestError(w http.ResponseWriter, err error)
- func WriteInternalServerError(w http.ResponseWriter, err error)
- type Option
- type Options
- type Trie
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrNotFound = errors.New("route not found") ErrMethodNotAllowed = errors.New("method not allowed") )
Functions ¶
func NewClientTrace ¶ added in v3.10.28
func NewRoundTripper ¶
func NewRoundTripper(opts ...Option) http.RoundTripper
NewRoundTripper creates new http RoundTripper
func RegisterMethod ¶ added in v3.8.8
RegisterMethod adds support for custom HTTP method handlers
func RequestToContext ¶
RequestToContext puts the `Authorization` header bearer token into context so calls to services will be authorized.
func Write ¶
func Write(w http.ResponseWriter, contentType string, status int, body string)
Write sets the status and body on a http ResponseWriter
func WriteBadRequestError ¶
func WriteBadRequestError(w http.ResponseWriter, err error)
WriteBadRequestError sets a 400 status code
func WriteInternalServerError ¶
func WriteInternalServerError(w http.ResponseWriter, err error)
WriteInternalServerError sets a 500 status code
Types ¶
Click to show internal directories.
Click to hide internal directories.