Documentation
¶
Index ¶
- Constants
- func AssignForm(form any, data map[string]any)
- func CommonTemplateContextData() reqctx.ContextData
- 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 GetRedirectToCookie(req *http.Request) 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 RedirectLinkUserLogin(req *http.Request) string
- func ReportValidationError(errs binding.Errors, data map[string]any, ...) binding.Errors
- 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 ¶
View Source
const ( CookieWebBannerDismissed = "gitea_disbnr" CookieTheme = "gitea_theme" )
View Source
const ContextDataKeySignedUser = "SignedUser"
Variables ¶
This section is empty.
Functions ¶
func AssignForm ¶
AssignForm assign form values back to the template data.
func CommonTemplateContextData ¶
func CommonTemplateContextData() reqctx.ContextData
func DeleteRedirectToCookie ¶
func DeleteRedirectToCookie(resp http.ResponseWriter)
DeleteRedirectToCookie convenience function to delete most cookies consistently
func GetContextData ¶
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 GetRedirectToCookie ¶
func GetSiteCookie ¶
GetSiteCookie returns given cookie value from request header.
func Locale ¶
func Locale(resp http.ResponseWriter, req *http.Request) translation.Locale
Locale handle locale
func RedirectLinkUserLogin ¶
func ReportValidationError ¶
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 ¶
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.
func ParseCookieFlashMessage ¶
Click to show internal directories.
Click to hide internal directories.