Documentation
¶
Index ¶
- func Errorf(w http.ResponseWriter, r *http.Request, format string, args ...any)
- func GetQuotedRemoteAddr(r *http.Request) string
- func GetRequestURI(r *http.Request) string
- func Serve(addr string, rh httpserver.RequestHandler, tlsConfig *tls.Config)
- func Stop(addrs []string) error
- type ErrorWithStatusCode
- type ServeOptions
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetQuotedRemoteAddr ¶
GetQuotedRemoteAddr returns quoted remote address.
func GetRequestURI ¶
GetRequestURI returns requestURI for r.
func Serve ¶
func Serve(addr string, rh httpserver.RequestHandler, tlsConfig *tls.Config)
Serve starts an http server on the given addrs with the given optional rh.
By default, all the responses are transparently compressed, since egress traffic is usually expensive.
Types ¶
type ErrorWithStatusCode ¶
ErrorWithStatusCode is error with HTTP status code.
The given StatusCode is sent to client when the error is passed to Errorf.
func (*ErrorWithStatusCode) Error ¶
func (e *ErrorWithStatusCode) Error() string
Error implements error interface.
func (*ErrorWithStatusCode) Unwrap ¶
func (e *ErrorWithStatusCode) Unwrap() error
Unwrap returns e.Err.
This is used by standard errors package. See https://golang.org/pkg/errors
type ServeOptions ¶
type ServeOptions struct{}
ServeOptions defines optional parameters for http server
Click to show internal directories.
Click to hide internal directories.