Documentation
¶
Index ¶
- func GetParsedQueryParamOrDefault[T parser.ParseType](r *http.Request, key string, defaultValue T) T
- func GetPathParam(r *http.Request, key string) string
- func GetPathParamOrDefault(r *http.Request, key, defaultValue string) string
- func GetQueryParam(r *http.Request, key string) string
- func GetQueryParamOrDefault(r *http.Request, key, defaultValue string) string
- func GetUploadedFile(r *http.Request, field string, maxMultipartFormSize int64) ([]*multipart.FileHeader, error)
- func ReadUploadedFile(r *http.Request, field string, maxMultipartFormSize int64) ([]byte, error)
- func ReadUploadedFiles(r *http.Request, field string, maxMultipartFormSize int64) ([][]byte, error)
- type Builder
- type Handler
- type UploadedFile
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetPathParam ¶
GetPathParam gets a path parameter
func GetPathParamOrDefault ¶
GetPathParamOrDefault gets a path parameter with default value
func GetQueryParam ¶
GetQueryParam gets a query parameter
func GetQueryParamOrDefault ¶
GetQueryParamOrDefault gets a query parameter with default value
func GetUploadedFile ¶
func ReadUploadedFile ¶
Types ¶
type Builder ¶
type Builder interface {
WithContext(ctx context.Context) Builder
WithMethod(method string) Builder
WithURL(url string) Builder
WithHeader(key, value string) Builder
WithFormFile(key string, file *UploadedFile) Builder
WithFormField(key, value string) Builder
WithBodyJSON(body any) Builder
Build() (*http.Request, error)
}
type Handler ¶
type Handler func(w http.ResponseWriter, r *http.Request)
Handler is a function that handles a request
type UploadedFile ¶
func NewUploadedFile ¶
func NewUploadedFile(content []byte, name string, contentType string) *UploadedFile
Click to show internal directories.
Click to hide internal directories.