Documentation ¶
Index ¶
- func Authorization(w http.ResponseWriter, r *http.Request) (token string, ok bool)
- func BadRequest(w http.ResponseWriter, rej any)
- func Download(endpoint string, req any) (r io.ReadCloser, err error)
- func Forbidden(w http.ResponseWriter, rej any)
- func InternalServerError(w http.ResponseWriter, rej any)
- func ParseRequest(w http.ResponseWriter, r *http.Request, req any) (ok bool)
- func ParseResponse(r *http.Response, resp any) (err error)
- func Reject(w http.ResponseWriter, rej any, code int)
- func Respond(w http.ResponseWriter, resp any)
- func RoundTrip(endpoint string, req any, resp any) (err error)
- 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)
- func Upload(endpoint string, r io.ReadCloser, resp any) (err error)
- type Client
- type ResponseError
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Authorization ¶
func BadRequest ¶
func BadRequest(w http.ResponseWriter, rej any)
func Forbidden ¶
func Forbidden(w http.ResponseWriter, rej any)
func InternalServerError ¶
func InternalServerError(w http.ResponseWriter, rej any)
func ParseRequest ¶
func Respond ¶
func Respond(w http.ResponseWriter, resp any)
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 Client ¶ added in v0.0.2
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.