Documentation
¶
Index ¶
- Constants
- func BindJSON[T any](w http.ResponseWriter, r *http.Request) (T, bool)
- func HandleJSON[TReq any, TResp any](fn func(context.Context, TReq) (TResp, error)) http.HandlerFunc
- func JSON(w http.ResponseWriter, status int, value any)
- func NewServer(addr string, handler http.Handler, opts ...Option) *http.Server
- func ReadBody(w http.ResponseWriter, r *http.Request) ([]byte, bool)
- func RequestID(ctx context.Context) string
- type Config
- type Engine
- func (e *Engine) Get(path string, handler http.HandlerFunc)
- func (e *Engine) Group(prefix string) *Group
- func (e *Engine) Handler() http.Handler
- func (e *Engine) Post(path string, handler http.HandlerFunc)
- func (e *Engine) ServeHTTP(w http.ResponseWriter, r *http.Request)
- func (e *Engine) Use(middlewares ...func(http.Handler) http.Handler)
- type Group
- type Option
Constants ¶
View Source
const ( HeaderRequestID = "X-Request-ID" DefaultMaxJSONBody = int64(1 << 20) )
Variables ¶
This section is empty.
Functions ¶
func HandleJSON ¶
Types ¶
Click to show internal directories.
Click to hide internal directories.