Documentation ¶
Index ¶
- func DefaultStatusBadRequest(r *http.Request, w http.ResponseWriter) error
- func DefaultStatusInternalServerError(r *http.Request, w http.ResponseWriter) error
- func DefaultStatusMethodNotAllowed(r *http.Request, w http.ResponseWriter) error
- func JoinPath(ptr API, url string) string
- type API
- type BaseAPI
- type Body
- type Header
- type IOResponse
- type JSON
- type JSONResponse
- type Middleware
- type Param
- type Path
- type Request
- type Response
- type ResponseInf
- type Server
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DefaultStatusBadRequest ¶ added in v0.0.3
func DefaultStatusBadRequest(r *http.Request, w http.ResponseWriter) error
func DefaultStatusInternalServerError ¶ added in v0.0.3
func DefaultStatusInternalServerError(r *http.Request, w http.ResponseWriter) error
func DefaultStatusMethodNotAllowed ¶ added in v0.0.3
func DefaultStatusMethodNotAllowed(r *http.Request, w http.ResponseWriter) error
Types ¶
type BaseAPI ¶ added in v0.0.3
func (*BaseAPI) Middleware ¶ added in v0.0.4
type Body ¶
type Body[T any] struct { Value T }
func (*Body[T]) ParseRequest ¶
type Header ¶
type Header[T any] struct { Value T }
func (*Header[T]) ParseRequest ¶
type IOResponse ¶
type IOResponse struct { Code int Data io.ReadCloser }
func (*IOResponse) Doc ¶ added in v0.0.6
func (r *IOResponse) Doc(operation *openapi3.Operation) error
func (*IOResponse) WriteResponse ¶
func (r *IOResponse) WriteResponse(w http.ResponseWriter) error
type JSON ¶
type JSON[T any] struct { Value T }
func (*JSON[T]) ParseRequest ¶
type JSONResponse ¶
func (*JSONResponse[T]) Doc ¶ added in v0.0.3
func (r *JSONResponse[T]) Doc(operation *openapi3.Operation) error
func (*JSONResponse[T]) WriteResponse ¶
func (r *JSONResponse[T]) WriteResponse(w http.ResponseWriter) error
type Middleware ¶ added in v0.0.3
type Middleware = func(*http.Request, http.ResponseWriter) error
type Param ¶
type Param[T any] struct { Value T }
func (*Param[T]) ParseRequest ¶
type Response ¶
type Response struct {
Value http.ResponseWriter
}
func (*Response) ParseRequest ¶
type ResponseInf ¶
type ResponseInf interface {
WriteResponse(http.ResponseWriter) error
}
type Server ¶
type Server struct { Mux *http.ServeMux Addr string StatusBadRequest Middleware StatusMethodNotAllowed Middleware StatusInternalServerError Middleware // contains filtered or unexported fields }
func (*Server) Middleware ¶ added in v0.0.3
Click to show internal directories.
Click to hide internal directories.