Documentation ¶
Overview ¶
Insight 0+0各包共同使用的辅助函数
Index ¶
- func AbsoluteFile(file, abs string) (absolute string)
- func AbsolutePath(path, abs string) (absolute string)
- func CommandSplit(command string, trim bool) (split []string, err error)
- func DecodeSalt(str, stream, salt string) string
- func DirMustEnd(dir string) string
- func EncodeSalt(str, stream, salt string) string
- func FileExist(filename string) bool
- func GetCurrPath() string
- func IsOdd(num int) bool
- func LocalFile(path string) string
- func LocalPath(path string) string
- func PathMustBegin(path string) string
- func SplitUrl(url string) (urla []string, parameter map[string]string)
- func SplitWords(str string) (normal [][]string)
- func StringInSlice(list []string, s string) bool
- type InputProcessor
- func (ip *InputProcessor) EditorIn(text string, cannull bool, min, max int64) (textc string, err int)
- func (ip *InputProcessor) EditorRe(text string) string
- func (ip *InputProcessor) Email(text string, cannull bool, min, max int64) (textc string, err int)
- func (ip *InputProcessor) Enum(text string, cannull bool, enum []string) (textc string, err int)
- func (ip *InputProcessor) Float(text string, cannull bool, min, max float64) (num float64, err int)
- func (ip *InputProcessor) Int(text string, cannull bool, min, max int64) (num int64, err int)
- func (ip *InputProcessor) Mark(text string, cannull bool, min, max int64) (textc string, err int)
- func (ip *InputProcessor) Password(text string, cannull bool) (textc string, err int)
- func (ip *InputProcessor) PasswordTwo(text, text2 string, cannull bool) (textc string, err int)
- func (ip *InputProcessor) Regular(text string, cannull bool, rg string) (textc string, err int)
- func (ip *InputProcessor) StringEnum(text string, canull bool, enum []string) (textc string, err int)
- func (ip *InputProcessor) Text(text string, cannull bool, min, max int64) (textc string, err int)
- func (ip *InputProcessor) TextareaOut(text string, thetype bool) string
- func (ip *InputProcessor) Url(text string, cannull bool, min, max int64) (textc string, err int)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AbsoluteFile ¶
生成绝对文件路径,如果给定的path不是绝对路径(以/开头),则用给定的abs补充并返回绝对文件地址,否则直接返回file
func AbsolutePath ¶
生成绝对路径,如果给定的path不是绝对路径(以/开头),则用给定的abs补充并返回绝对路径(以/结尾),否则直接返回path(并以/结尾)
func CommandSplit ¶
Split the string, if trim is true, the split with out space.
func StringInSlice ¶
Types ¶
type InputProcessor ¶
type InputProcessor struct {
// contains filtered or unexported fields
}
InputProcessor 输入处理器
func (*InputProcessor) EditorIn ¶
func (ip *InputProcessor) EditorIn(text string, cannull bool, min, max int64) (textc string, err int)
处理编辑器的输入,除了字数检测外,主要是过滤script标签
func (*InputProcessor) Password ¶
func (ip *InputProcessor) Password(text string, cannull bool) (textc string, err int)
处理密码
func (*InputProcessor) PasswordTwo ¶
func (ip *InputProcessor) PasswordTwo(text, text2 string, cannull bool) (textc string, err int)
查看两遍密码
func (*InputProcessor) StringEnum ¶
func (ip *InputProcessor) StringEnum(text string, canull bool, enum []string) (textc string, err int)
字符串枚举
func (*InputProcessor) TextareaOut ¶
func (ip *InputProcessor) TextareaOut(text string, thetype bool) string
处理文本域的输出,主要就是对换行符进行处理,将\r\n之类的转换成<p>或<br>,thetype为true则转成<p>,type为false则转为<br>
Click to show internal directories.
Click to hide internal directories.