Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BindBody ¶
BindBody binds the request body to the given struct. If it fails, an error is returned, that you can directly return from your handler.
func RegisterRoute ¶
RegisterRoute registers a single Route on the given router group. It delegates to gin.IRoutes.Handle using the method and path reported by the route itself, so each handler is self-describing and no central routing table is needed.
func ToGinHandler ¶
func ToGinHandler(h Handler) gin.HandlerFunc
func WithLogging ¶
func WithLogging() gin.HandlerFunc
func WithRequestID ¶
func WithRequestID() gin.HandlerFunc
Types ¶
type HandleFunc ¶
HandleFunc is a function type that satisfies Handler, allowing plain functions to be used as handlers without defining a struct.
type Handler ¶
Handler is the core interface for an HTTP endpoint. Every route handler must implement Handle to process a request and write a response.
type Route ¶
type Route interface {
Handler
// Method returns the HTTP method (e.g. "GET", "POST") for this route.
Method() string
// Path returns the URL path pattern (e.g. "/v1/tenants/:id") for this route.
Path() string
}
Route extends Handler with the HTTP method and URL path that the handler should be mounted on. Implementing this interface allows each handler to be self-describing and registered via RegisterRoute without a central routing table.