Documentation
¶
Overview ¶
Package basic provides a simple HTTP handler type for form-based request/response handling.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Handler ¶
type Handler struct {
// contains filtered or unexported fields
}
Handler wraps a typed function and handles HTTP request decoding and response writing.
func NewHandler ¶
func NewHandler(reqType RequestType, fn any) *Handler
NewHandler returns a Handler for the given request type and handler function.
func (*Handler) Error ¶
func (*Handler) Error() rf.ErrorHandlerFunc
Error returns the rf.ErrorHandlerFunc for this handler.
func (*Handler) Handle ¶
func (h *Handler) Handle() rf.HandlerFunc
Handle returns the rf.HandlerFunc for this handler.
type RequestType ¶
type RequestType int
RequestType indicates how the handler should decode the incoming HTTP request.
const ( // GetParams decodes the handler input from URL query parameters. GetParams RequestType = iota // PostForm decodes the handler input from a POST form body. PostForm )
Click to show internal directories.
Click to hide internal directories.