package
0.0.0-20210604230344-19bee3a11d65
Repository: https://github.com/tossp/tsgo.git
Documentation: pkg.go.dev
# Functions
AcceptedLanguages returns an array of accepted languages denoted by the Accept-Language header sent by the browser.
ClientIP implements a best effort algorithm to return the real client IP, it parses X-Real-IP and X-Forwarded-For in order to work properly with reverse-proxies such us: nginx or haproxy.
No description provided by the author
No description provided by the author
No description provided by the author
Copy copies src to dest, doesn't matter if src is a directory or a file.
No description provided by the author
FileSize calculates the file size and generate user-friendly string.
No description provided by the author
convert interface to bool.
convert interface to float64.
convert interface to int.
convert interface to int64.
GetRandomString 通过指定字符集,生成随机字符串.
convert interface to string.
GonicCasedName 转换字符串.
No description provided by the author
HTMLEscape writes to w the escaped HTML equivalent of the plain text data b.
HTMLEscaper returns the escaped HTML equivalent of the textual representation of its arguments.
HTMLEscapeString returns the escaped HTML equivalent of the plain text data s.
No description provided by the author
No description provided by the author
检查文件或目录是否存在 如果由 filename 指定的文件或目录存在则返回 true,否则返回 false.
JSEscape writes to w the escaped JavaScript equivalent of the plain text data b.
JSEscaper returns the escaped JavaScript equivalent of the textual representation of its arguments.
JSEscapeString returns the escaped JavaScript equivalent of the plain text data s.
No description provided by the author
Must is a helper that wraps a call to a function returning (*Template, error) and panics if the error is non-nil.
No description provided by the author
No description provided by the author
New allocates a new HTML template with the given name.
No description provided by the author
No description provided by the author
ParseFiles creates a new Template and parses the template definitions from the named files.
ParseGlob creates a new Template and parses the template definitions from the files identified by the pattern, which must match at least one file.
SqlPlaceholder 生成SQL占位符.
stripTags takes a snippet of HTML and returns only the text content.
No description provided by the author
No description provided by the author
URLQueryEscaper returns the escaped value of the textual representation of its arguments in a form suitable for embedding in a URL query.
No description provided by the author
No description provided by the author
No description provided by the author
# Constants
HTTP Header keys.
HTTP Header keys.
HTTP Header keys.
HTTP Header keys.
HTTP Header keys.
HTTP Header keys.
HTTP Header keys.
HTTP Header keys.
HTTP Header keys.
HTTP Header keys.
HTTP Header keys.
HTTP Header keys.
HTTP Header keys.
HTTP Header keys.
HTTP Header keys.
HTTP Header keys.
HTTP Header keys.
HTTP Header keys.
HTTP Header keys.
HTTP Header keys.
HTTP Header keys.
HTTP Header keys.
HTTP Header keys.
HTTP Header keys.
HTTP Header keys.
HTTP Header keys.
HTTP Header keys.
HTTP Header keys.
HTTP Header keys.
HTTP Header keys.
ErrAmbigContext: "..
ErrBadHTML: "expected space, attr name, or end of tag, but got ...", "..
ErrBranchEnd: "{{if}} branches end in different contexts" Example: {{if .C}}<a href="{{end}}{{.X}} Discussion: Package html/template statically examines each path through an {{if}}, {{range}}, or {{with}} to escape any following pipelines.
ErrEndContext: "..
ErrNoSuchTemplate: "no such template ..." Examples: {{define "main"}}<div {{template "attrs"}}>{{end}} {{define "attrs"}}href="{{.URL}}"{{end}} Discussion: Package html/template looks through template calls to compute the context.
ErrOutputContext: "cannot compute output context for template ..." Examples: {{define "t"}}{{if .T}}{{template "t" .T}}{{end}}{{.H}}",{{end}} Discussion: A recursive template does not end in the same context in which it starts, and a reliable output context cannot be computed.
ErrPartialCharset: "unfinished JS regexp charset in ..." Example: <script>var pattern = /foo[{{.Chars}}]/</script> Discussion: Package html/template does not support interpolation into regular expression literal character sets.
ErrPartialEscape: "unfinished escape sequence in ..." Example: <script>alert("\{{.X}}")</script> Discussion: Package html/template does not support actions following a backslash.
ErrRangeLoopReentry: "on range loop re-entry: ..." Example: <script>var x = [{{range .}}'{{.}},{{end}}]</script> Discussion: If an iteration through a range would cause it to end in a different context than an earlier pass, there is no single context.
ErrSlashAmbig: '/' could start a division or regexp.
HTTP Header keys.
HTTP Header keys.
HTTP Header keys.
HTTP Header keys.
HTTP Header keys.
HTTP Header keys.
HTTP Header keys.
HTTP Header keys.
HTTP Header keys.
HTTP Header keys.
HTTP Header keys.
HTTP Header keys.
HTTP Header keys.
OK indicates the lack of an error.
HTTP Header keys.
HTTP Header keys.
HTTP Header keys.
HTTP Header keys.
HTTP Header keys.
HTTP Header keys.
HTTP Header keys.
HTTP Header keys.
HTTP Header keys.
HTTP Header keys.
HTTP Header keys.
HTTP Header keys.
HTTP Header keys.
HTTP Header keys.
HTTP Header keys.
HTTP Header keys.
HTTP Header keys.
HTTP Header keys.
HTTP Header keys.
HTTP Header keys.
HTTP Header keys.
HTTP Header keys.
HTTP Header keys.
HTTP Header keys.
HTTP Header keys.
HTTP Header keys.
HTTP Header keys.
HTTP Header keys.
# Interfaces
No description provided by the author
# Type aliases
No description provided by the author
Strings of content from a trusted source.
ErrorCode is a code for a kind of error.
FuncMap is the type of the map defining the mapping from names to functions.
Strings of content from a trusted source.
Strings of content from a trusted source.
Strings of content from a trusted source.
Strings of content from a trusted source.
Strings of content from a trusted source.