Documentation ¶
Index ¶
- func CryptoRandSeq(n int) string
- func FilterIncludes[T comparable](src []T, list []T) []T
- func JSON(w http.ResponseWriter, j interface{}, status int)
- func ParseForm(w http.ResponseWriter, r *http.Request, out interface{}) bool
- func ParseJSON(w http.ResponseWriter, r *http.Request, out interface{}) bool
- func RandSeq(n int) string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CryptoRandSeq ¶
func FilterIncludes ¶
func FilterIncludes[T comparable](src []T, list []T) []T
Returns all items from `src` that also occur in `list` in a slice.
func JSON ¶
func JSON(w http.ResponseWriter, j interface{}, status int)
Marshals `j` and prints on `w` with `Content-Type: application/json`
func ParseForm ¶
func ParseForm(w http.ResponseWriter, r *http.Request, out interface{}) bool
Unmarshals body of `r` as x-www-form-urlencoded to `&out`. If error, prints error to `w` and returns `false`.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.