Documentation ¶
Index ¶
- Variables
- func DecodeBody(req *http.Request, obj any) error
- func DerefType(obj any) (reflect.Type, bool)
- func DerefValue(obj any) (reflect.Value, bool)
- func GenVal(t reflect.Type, value string, values ...string) (reflect.Value, error)
- func GetCookie(req *http.Request, key string) (string, error)
- func GetHeader(req *http.Request, key string) (string, error)
- func GetQueries(req *http.Request, key string) ([]string, error)
- func GetSegment(req *http.Request, key string) (string, error)
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ErrValueNotFound is the error returned from the Get* functions // when this value was not found in the request. ErrValueNotFound = errors.New("value not found") )
Functions ¶
func DecodeBody ¶
DecodeBody uses a json decoder to decode the body of the request into the target object.
func DerefType ¶
DerefType dereferences the type of the object if it is a pointer or an interface. Returns whether the final type is a struct.
func DerefValue ¶
DerefValue dereferences the value of the object until it is no longer a pointer or an interface. Also returns false if the underlying value is Nil.
func GetQueries ¶
GetQueries returns the list of values that this query parameter had in the request.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.