Documentation
¶
Index ¶
- func Method(handlers MethodMap) http.HandlerFunc
- func Panic(handler http.HandlerFunc) http.HandlerFunc
- func ReadHeaders(request *http.Request, headersDto interface{}) error
- func ReadJson(request *http.Request, requestDto interface{}) error
- func ReadPath(request *http.Request, pathDto interface{}) error
- func ReadQuery(request *http.Request, queryDto interface{}) error
- func WriteResponse(ctx WriteResponseContext, writer http.ResponseWriter, options ...WriteOption) error
- type Headers
- type MethodMap
- type WriteOption
- type WriteResponseContext
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Method ¶
func Method(handlers MethodMap) http.HandlerFunc
func Panic ¶
func Panic(handler http.HandlerFunc) http.HandlerFunc
func ReadHeaders ¶
func WriteResponse ¶
func WriteResponse(ctx WriteResponseContext, writer http.ResponseWriter, options ...WriteOption) error
Types ¶
type Headers ¶
func NewHeaders ¶ added in v0.1.1
func NewHeaders() Headers
type MethodMap ¶
type MethodMap map[string]http.HandlerFunc
type WriteOption ¶
type WriteOption func(*writeOptions)
func Code ¶
func Code(code int) WriteOption
func Fail ¶
func Fail(message string) WriteOption
func Header ¶
func Header(key, value string) WriteOption
func Message ¶
func Message(message string) WriteOption
func Payload ¶
func Payload(payload any) WriteOption
type WriteResponseContext ¶
type WriteResponseContext interface {
DefaultHeaders() Headers
}
Click to show internal directories.
Click to hide internal directories.