Documentation
¶
Overview ¶
This file contains a few routines for parsing form values
Index ¶
- func AddPrefixedValues(addedTo url.Values, toBeAdded url.Values, prefix string)
- func AddValues(addedTo url.Values, toBeAdded url.Values)
- func DateRangeToCGIArgs(s, e time.Time) string
- func DateRangeToValues(s, e time.Time) url.Values
- func ExtractAllCGIArgs(r *http.Request) url.Values
- func FormValueCheckbox(r *http.Request, name string) bool
- func FormValueCommaSepStrings(r *http.Request, name string) []string
- func FormValueCommaSpaceSepStrings(r *http.Request, name string) []string
- func FormValueDateRange(r *http.Request) (s, e time.Time, err error)
- func FormValueDuration(r *http.Request, name string) time.Duration
- func FormValueEpochTime(r *http.Request, name string) time.Time
- func FormValueFloat64(w http.ResponseWriter, r *http.Request, name string) float64
- func FormValueFloat64EatErrs(r *http.Request, name string) float64
- func FormValueFloat64WithDefault(r *http.Request, name string, dflt float64) float64
- func FormValueInt64(r *http.Request, name string) int64
- func FormValueIntWithDefault(r *http.Request, name string, dflt int) int
- func URLStringReplacingGETArgs(r *http.Request, vals *url.Values) string
- func ValuesIntoTemplateParams(stem string, values url.Values, params map[string]interface{})
- type Presenter
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddPrefixedValues ¶
func DateRangeToCGIArgs ¶
func ExtractAllCGIArgs ¶
ExtractAllCGIArgs gets both GET and POST arguments into a single map
func FormValueCommaSpaceSepStrings ¶
Separate by comma, or space
func FormValueDateRange ¶
Return values:
s will be the first second of the first day; e will be the last second of the last day;
For ranges of exactly one day, e and s will be in the same day.
Formats:
?date=today ?date=yesterday ?date=day&day=2006/01/02 ?date=range&range_from=2006/01/01&range_to=2018/01/01
func FormValueDuration ¶
As well as the normal syntax, we support "7d", where a day is 24*time.Hour.
func FormValueFloat64 ¶
func FormValueIntWithDefault ¶
func URLStringReplacingGETArgs ¶
Creates a URL that matches the request, adding the vals as CGI GET parameters
Types ¶
Click to show internal directories.
Click to hide internal directories.