Documentation
¶
Index ¶
- Constants
- func AssignForm(form any, data map[string]any)
- func CommonTemplateContextData() reqctx.ContextData
- func DeleteLocaleCookie(resp http.ResponseWriter)
- func DeleteRedirectToCookie(resp http.ResponseWriter)
- func GetContextData(c context.Context) reqctx.ContextData
- func GetInclude(field reflect.StructField) string
- func GetMaxSize(field reflect.StructField) string
- func GetMinSize(field reflect.StructField) string
- func GetSiteCookie(req *http.Request, name string) string
- func GetSize(field reflect.StructField) string
- func Locale(resp http.ResponseWriter, req *http.Request) translation.Locale
- func SetLocaleCookie(resp http.ResponseWriter, lang string, maxAge int)
- func SetRedirectToCookie(resp http.ResponseWriter, value string)
- func SetSiteCookie(resp http.ResponseWriter, name, value string, maxAge int)
- func Validate(errs binding.Errors, data map[string]any, f Form, l translation.Locale) binding.Errors
- type Flash
- type Form
Constants ¶
const ContextDataKeySignedUser = "SignedUser"
Variables ¶
This section is empty.
Functions ¶
func AssignForm ¶
AssignForm assign form values back to the template data.
func CommonTemplateContextData ¶ added in v1.20.0
func CommonTemplateContextData() reqctx.ContextData
func DeleteLocaleCookie ¶
func DeleteLocaleCookie(resp http.ResponseWriter)
DeleteLocaleCookie convenience function to delete the locale cookie consistently Setting the lang cookie will trigger the middleware to reset the language to previous state.
func DeleteRedirectToCookie ¶
func DeleteRedirectToCookie(resp http.ResponseWriter)
DeleteRedirectToCookie convenience function to delete most cookies consistently
func GetContextData ¶ added in v1.20.0
func GetContextData(c context.Context) reqctx.ContextData
func GetInclude ¶
func GetInclude(field reflect.StructField) string
GetInclude get include in form tag
func GetMaxSize ¶
func GetMaxSize(field reflect.StructField) string
GetMaxSize get max size in form tag
func GetMinSize ¶
func GetMinSize(field reflect.StructField) string
GetMinSize get minimal size in form tag
func GetSiteCookie ¶ added in v1.20.0
GetSiteCookie returns given cookie value from request header.
func Locale ¶
func Locale(resp http.ResponseWriter, req *http.Request) translation.Locale
Locale handle locale
func SetLocaleCookie ¶
func SetLocaleCookie(resp http.ResponseWriter, lang string, maxAge int)
SetLocaleCookie convenience function to set the locale cookie consistently
func SetRedirectToCookie ¶
func SetRedirectToCookie(resp http.ResponseWriter, value string)
SetRedirectToCookie convenience function to set the RedirectTo cookie consistently
func SetSiteCookie ¶ added in v1.20.0
func SetSiteCookie(resp http.ResponseWriter, name, value string, maxAge int)
SetSiteCookie returns given cookie value from request header.
Types ¶
type Flash ¶
type Flash struct { DataStore reqctx.RequestDataStore url.Values ErrorMsg, WarningMsg, InfoMsg, SuccessMsg string }
Flash represents a one time data transfer between two requests.