Documentation ¶
Index ¶
- func BadRequest(w http.ResponseWriter, rej any)
- func Delete(endpoint string) (r io.ReadCloser, err error)
- func Forbidden(w http.ResponseWriter, rej any)
- func Get(endpoint string) (r io.ReadCloser, err error)
- func GetAuthorization(h http.Header) (token string, ok bool)
- func InternalServerError(w http.ResponseWriter, rej any)
- func ParseRequest(w http.ResponseWriter, r *http.Request, req any) (ok bool)
- func ParseResponse(r io.ReadCloser, resp any) (err error)
- func Post(endpoint string, req any) (r io.ReadCloser, err error)
- func Put(endpoint string, body io.Reader) (r io.ReadCloser, err error)
- func Reject(w http.ResponseWriter, rej any, code int)
- func Respond(w http.ResponseWriter, resp any)
- func SetAuthorization(h http.Header, token string)
- func SetLogFile(w io.Writer)
- func Teapot(w http.ResponseWriter, rej any)
- func TeapotHandler(rej any) http.Handler
- func Unauthorized(w http.ResponseWriter, rej any)
- type Client
- type ResponseError
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BadRequest ¶
func BadRequest(w http.ResponseWriter, rej any)
func Forbidden ¶
func Forbidden(w http.ResponseWriter, rej any)
func GetAuthorization ¶ added in v0.9.0
func InternalServerError ¶
func InternalServerError(w http.ResponseWriter, rej any)
func ParseRequest ¶
func ParseResponse ¶
func ParseResponse(r io.ReadCloser, resp any) (err error)
func Respond ¶
func Respond(w http.ResponseWriter, resp any)
func SetAuthorization ¶ added in v0.9.0
func SetLogFile ¶ added in v0.7.0
func Teapot ¶
func Teapot(w http.ResponseWriter, rej any)
func TeapotHandler ¶
func Unauthorized ¶
func Unauthorized(w http.ResponseWriter, rej any)
Types ¶
type ResponseError ¶
type ResponseError struct { StatusCode int Message json.RawMessage }
func (*ResponseError) Error ¶
func (re *ResponseError) Error() string
Click to show internal directories.
Click to hide internal directories.