package
0.0.0-20201020011259-aba033f76660
Repository: https://github.com/qorx/qor.git
Documentation: pkg.go.dev
# Functions
ExitWithMsg debug error messages and print stack.
FileServer file server that disabled file listing.
GetAbsURL get absolute URL from request, refer: https://stackoverflow.com/questions/6899069/why-are-request-url-host-and-scheme-blank-in-the-development-server.
GOPATH return GOPATH from env.
HumanizeString Humanize separates string based on capitalizd letters e.g.
Indirect returns last value that v points to.
JoinURL updates the path part of the request url.
ModelType get value's model type.
NewValue new struct value with reflect type.
ParamsMatch match string by param.
ParseTagOption parse tag options to hash.
PatchURL updates the query part of the request url.
SafeJoin safe join https://snyk.io/research/zip-slip-vulnerability#go.
SetCookie set cookie for context.
SliceUniq removes duplicate values in given slice.
SortFormKeys sort form keys.
Stringify stringify any data, if it is a struct, will try to use its Name, Title, Code field, else will use its primary key.
ToArray get array from value, will ignore blank string to convert it to array.
ToFloat get float from value, if passed value is empty string, result will be 0.
ToInt get int from value, if passed value is empty string, result will be 0.
ToParamString replaces spaces and separates words (by uppercase letters) with underscores in a string, also downcase it e.g.
ToString get string from value, if passed value is a slice, will use the first element.
ToUint get uint from value, if passed value is empty string, result will be 0.
# Variables
AppRoot app root path.
ContextDBName db name used for context.
FormatTime format time to string Overwrite the default logic with utils.FormatTime = func(time time.Time, format string, context *qor.Context) string { // ...
GetDBFromRequest get database from request.
GetLocale get locale from request, cookie, after get the locale, will write the locale to the cookie if possible Overwrite the default logic with utils.GetLocale = func(context *qor.Context) string { // ...
HTMLSanitizer html sanitizer to avoid XSS.
ParseTime parse time from string Overwrite the default logic with utils.ParseTime = func(timeStr string, context *qor.Context) (time.Time, error) { // ...
# Structs
ClosingReadSeeker implement Closer interface for ReadSeeker.
# Type aliases
ContextKey defined type used for context's key.