Documentation
¶
Overview ¶
核心支持库工具函数库 增强核心支持库的功能
Index ¶
- func Env(环境变量名称 string, 默认值 string) string
- func E创建目录多级(欲创建的目录名称 string) error
- func E判断文本(内容 string, 关键字 ...interface{}) bool
- func E判断文本s(内容 string, 关键字 ...interface{}) string
- func E判断文本前缀(s string, 前缀 string) bool
- func E判断文本后缀(s string, 后缀 string) bool
- func E到Json(v interface{}) string
- func E加载环境变量_从内容到map(s string) (map[string]string, error)
- func E加载环境变量_从文件(filepath string) bool
- func E取md5(data []byte) string
- func E取md5从文本(str string) string
- func E取uuid() string
- func E取文本字数(value string) int
- func E取短id() string
- func E取随机ip() string
- func E命令行解析()
- func E文件_保存(文件名 string, 欲写入文件的数据 interface{}) error
- func E文件_写出(文件名 string, 欲写入文件的数据 interface{}) error
- func E文件_删除(欲删除的文件名 string) bool
- func E文件_取扩展名(filepath string) string
- func E文件_取文件名(路径 string) string
- func E文件_取父目录(dirpath string) string
- func E文件_更名(欲更名的原文件或目录名 string, ...) bool
- func E文件_枚举(欲寻找的目录 string, 欲寻找的文件名 string, files *[]string, ...) error
- func E文件_路径合并处理(elem ...string) string
- func E文件_追加文本(文件名 string, 欲追加的文本 string) error
- func E文本_删中间(欲处理文本 string, 起始位置 int64, 删除长度 int64) string
- func E文本_删右边(欲处理文本 string, 删除长度 int64) string
- func E文本_删左边(欲处理文本 string, 删除长度 int64) string
- func E文本_单词首字母大写(s string) string
- func E文本_取出中间文本(内容 string, 左边文本 string, 右边文本 string) string
- func E文本_取出文本中汉字(s string) string
- func E文本_取右边(被查找的文本 string, 欲寻找的文本 string) string
- func E文本_取左边(被查找的文本 string, 欲寻找的文本 string) string
- func E文本_取随机姓氏() string
- func E文本_取随机字母(要取的字符数 int, 字母类型 int) string
- func E文本_取随机字母和数字(要取的字符数 int) string
- func E文本_取随机数字(要取的字符数 int) string
- func E文本_句子首字母大写(s string) string
- func E文本_搜索切片文本(a []string, s string) int
- func E文本_是否为大写字母(s string) bool
- func E文本_是否为字母(s string) bool
- func E文本_是否为小写字母(s string) bool
- func E文本_是否为数字(s string) bool
- func E文本_是否为汉字(s string) bool
- func E文本_相似文本(first, second string, percent *float64) int
- func E文本_自动换行(s string, 每行几个字符 int, 分隔符 string) string
- func E文本_自动补零(s string, len int) string
- func E文本_逐字分割(s string) []string
- func E文本_随机文本(s string) string
- func E文本_颠倒(s string) string
- func E文本_首字母改大写(s string) string
- func E文本区分_只取字母(s string) string
- func E文本区分_只取数字(s string) string
- func E文本区分_只取汉子(s string) string
- func E文本区分_只取符号(s string) string
- func E格式化文本(format string, a ...interface{}) string
- func E目录_枚举子目录(父文件夹路径 string, 子目录数组 *[]string, 是否带路径 bool, ...) error
- func E计算数学表达式(v string) string
- func E设置命令行(name string, defaultvalue string, help string, value *string)
- func E读入文本(文件名 string) string
- func E路径_创建多级目录(要创建的目录 string) bool
- func E路径_合并(elem ...string) string
- func Json解析(data string, path string) gjson.Result
- func Json解析文本(data string, path string) string
- func RunJs(content string, functionName string, args ...interface{}) string
- func StrCut(内容 string, 表达式 string) string
- type E时间统计类
- type E正则表达式
- func (this *E正则表达式) E创建(正则表达式文本 string, 被搜索的文本 string) bool
- func (this *E正则表达式) E取匹配数量() int
- func (this *E正则表达式) E取匹配文本(匹配索引 int) string
- func (this *E正则表达式) E取子匹配数量() int
- func (this *E正则表达式) E取子匹配文本(匹配索引 int, 子表达式索引 int) string
- func (this *E正则表达式) E替换(用作替换的文本 string) string
- func (this *E正则表达式) GetResult() [][]string
- type E线程池
- type E读写共享锁
- type E配置项
- func (this *E配置项) E写到文件(fileapth string)
- func (this *E配置项) E写配置项(节名称 string, 配置项名称 string, 设置文本 string) bool
- func (this *E配置项) E加载配置项从内存(v string) bool
- func (this *E配置项) E加载配置项从文件(fileapth string) bool
- func (this *E配置项) E取节名() []string
- func (this *E配置项) E取项名(节名称 string) []string
- func (this *E配置项) E设置节名不区分大小写()
- func (this *E配置项) E读配置项(节名称 string, 配置项名称 string, 默认文本 string) string
- type StrArray
- func (a *StrArray) Append(value ...string) *StrArray
- func (a *StrArray) Chunk(size int) [][]string
- func (a *StrArray) Clear() *StrArray
- func (a *StrArray) Clone() (newArray *StrArray)
- func (a *StrArray) Contains(value string) bool
- func (a *StrArray) CountValues() map[string]int
- func (a *StrArray) E删除成员(欲删除的位置 int)
- func (a *StrArray) E加入成员(s string)
- func (a *StrArray) E取(i int) string
- func (a *StrArray) E取数组成员数() int
- func (a *StrArray) E插入成员(欲插入的位置 int, 欲插入的成员数据 string)
- func (a *StrArray) E数组排序(排序方向是否为从小到大 bool)
- func (a *StrArray) E清除数组()
- func (a *StrArray) Fill(startIndex int, num int, value string) *StrArray
- func (a *StrArray) Get(index int) string
- func (a *StrArray) InsertAfter(index int, value string) *StrArray
- func (a *StrArray) InsertBefore(index int, value string) *StrArray
- func (a *StrArray) Interfaces() []interface{}
- func (a *StrArray) Iterator(f func(k int, v string) bool)
- func (a *StrArray) IteratorAsc(f func(k int, v string) bool)
- func (a *StrArray) IteratorDesc(f func(k int, v string) bool)
- func (a *StrArray) Join(glue string) string
- func (a *StrArray) Len() int
- func (a *StrArray) LockFunc(f func(Array []string)) *StrArray
- func (a *StrArray) MarshalJSON() ([]byte, error)
- func (a *StrArray) Pad(size int, value string) *StrArray
- func (a *StrArray) PopLeft() string
- func (a *StrArray) PopLefts(size int) []string
- func (a *StrArray) PopRand() string
- func (a *StrArray) PopRands(size int) []string
- func (a *StrArray) PopRight() string
- func (a *StrArray) PopRights(size int) []string
- func (a *StrArray) PushLeft(value ...string) *StrArray
- func (a *StrArray) PushRight(value ...string) *StrArray
- func (a *StrArray) RLockFunc(f func(Array []string)) *StrArray
- func (a *StrArray) Rand() string
- func (a *StrArray) Rands(size int) []string
- func (a *StrArray) Range(start int, end ...int) []string
- func (a *StrArray) Remove(index int) string
- func (a *StrArray) RemoveValue(value string) bool
- func (a *StrArray) Replace(Array []string) *StrArray
- func (a *StrArray) Reverse() *StrArray
- func (a *StrArray) Search(value string) int
- func (a *StrArray) Set(index int, value string) *StrArray
- func (a *StrArray) SetArray(Array []string) *StrArray
- func (a *StrArray) Shuffle() *StrArray
- func (a *StrArray) Slice() []string
- func (a *StrArray) Sort(reverse ...bool) *StrArray
- func (a *StrArray) SortFunc(less func(v1, v2 string) bool) *StrArray
- func (a *StrArray) String() string
- func (a *StrArray) SubSlice(offset int, length ...int) []string
- func (a *StrArray) Sum() (sum int)
- func (a *StrArray) Unique() *StrArray
- func (a *StrArray) UnmarshalJSON(b []byte) error
- func (a *StrArray) UnmarshalValue(value interface{}) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func E判断文本 ¶
子程序名:判断文本 真 找到 假 找不到 返回值类型:逻辑型 参数<1>的名称为“与判断的文本”,类型为“文本型”。 参数<2>的名称为“关键字”,类型为“文本型”,允许接收空参数数据。 参数<3>的名称为“更多关键字”,类型为“文本型”,允许接收空参数数据,需要接收数组数据。
func E文件_枚举 ¶
子程序名:文件_枚举 枚举某个目录下的指定类型文件;成功返回文件数量; 返回值类型:整数型 参数<1>的名称为“欲寻找的目录”,类型为“文本型”。注明:文件目录。 参数<2>的名称为“欲寻找的文件名”,类型为“文本型”。注明:如果寻找全部文件可以填入空白,.txt|.jpg找txt和jpg的文件 参数<3>的名称为“文件数组”,类型为“文本型”,接收参数数据时采用参考传递方式,允许接收空参数数据,需要接收数组数据。注明:用于装载文件数组的变量;把寻找到的文件都放在这个数组里,并返回;。 参数<4>的名称为“是否带路径”,类型为“逻辑型”,允许接收空参数数据。注明:默认为假; 真=带目录路径,如C:\012.txt; 假=不带,如 012.txt;。 参数<6>的名称为“是否遍历子目录”,类型为“逻辑型”,允许接收空参数数据。注明:留空默认为假;为真时文件数组不主动清空。
func E文件_路径合并处理 ¶
func E文本_单词首字母大写 ¶
func E文本_取出文本中汉字 ¶
func E文本_取随机字母 ¶
子程序名:文本_取随机字母 取随机26个字母! 返回值类型:文本型 参数<1>的名称为“要取的字符数”,类型为“整数型”。注明:要取字符个数;。 参数<2>的名称为“字母类型”,类型为“整数型”,允许接收空参数数据。注明:可空:默认为小写字母;0=小写字母;1=大写字母;2=大小写字母混合;。
func E文本_取随机字母和数字 ¶
func E文本_句子首字母大写 ¶
func E文本_搜索切片文本 ¶
func E文本_是否为大写字母 ¶
func E文本_是否为小写字母 ¶
func E文本_首字母改大写 ¶
func E文本区分_只取字母 ¶
func E文本区分_只取数字 ¶
func E文本区分_只取汉子 ¶
func E文本区分_只取符号 ¶
func E路径_创建多级目录 ¶
调用格式: 〈逻辑型〉 路径_创建多级目录 (文本型 要创建的目录) - E2EE互联网服务器套件2.2.3->路径处理 英文名称:PathMakeAnyDir 创建任意级别的目录。目录存在直接返回真,不存在创建成功也返回真,创建失败返回假。本命令为初级命令。 参数<1>的名称为“要创建的目录”,类型为“文本型(text)”。要创建的目录路径。
操作系统需求: Windows
func E路径_合并 ¶
调用格式: 〈文本型〉 路径_合并 (文本型 路径1,文本型 路径2,... ) - E2EE互联网服务器套件2.2.3->路径处理 英文名称:PathJoin 合并多个路径。假设第一个路径为目录,路径之间将通过“/”连接。两个路径均支持相对路径符号“./”和“../”。路径不区分“\”和“/”,最终生成的路径都以“/”为主。本命令为初级命令。命令参数表中最后一个参数可以被重复添加。 参数<1>的名称为“路径1”,类型为“文本型(text)”。第一个路径。可以为相对路径。 参数<2>的名称为“路径2”,类型为“文本型(text)”。第二个路径。可以为相对路径。
操作系统需求: Windows
Types ¶
type E正则表达式 ¶
type E配置项 ¶
type E配置项 struct {
// contains filtered or unexported fields
}
func (*E配置项) E设置节名不区分大小写 ¶
func (this *E配置项) E设置节名不区分大小写()
type StrArray ¶
type StrArray struct { Array []string // contains filtered or unexported fields }
func NewStrArray ¶
NewStrArray creates and returns an empty Array. The parameter <safe> is used to specify whether using Array in concurrent-safety, which is false in default.
func NewStrArrayFrom ¶
NewStrArrayFrom creates and returns an Array with given slice <Array>. The parameter <safe> is used to specify whether using Array in concurrent-safety, which is false in default.
func NewStrArrayFromCopy ¶
NewStrArrayFromCopy creates and returns an Array from a copy of given slice <Array>. The parameter <safe> is used to specify whether using Array in concurrent-safety, which is false in default.
func NewStrArraySize ¶
NewStrArraySize create and returns an Array with given size and cap. The parameter <safe> is used to specify whether using Array in concurrent-safety, which is false in default.
func (*StrArray) Chunk ¶
Chunk splits an Array into multiple Arrays, the size of each Array is determined by <size>. The last chunk may contain less than size elements.
func (*StrArray) CountValues ¶
CountValues counts the number of occurrences of all values in the Array.
func (*StrArray) E数组排序 ¶
调用格式: 〈无返回值〉 数组排序 (通用型变量数组 数值数组变量,[逻辑型 排序方向是否为从小到大]) - 系统核心支持库->数组操作 英文名称:SortAry 对指定数值数组变量内的所有数组成员进行快速排序,不影响数组的维定义信息,排序结果存放回该数组变量。本命令为初级命令。 参数<1>的名称为“数值数组变量”,类型为“通用型(all)”,提供参数数据时只能提供变量数组。 参数<2>的名称为“排序方向是否为从小到大”,类型为“逻辑型(bool)”,可以被省略。如果参数值为真,排序方向为从小到大,否则为从大到小。如果本参数被省略,默认值为真。
操作系统需求: Windows、Linux
func (*StrArray) Fill ¶
Fill fills an Array with num entries of the value <value>, keys starting at the <startIndex> parameter.
func (*StrArray) Get ¶
Get returns the value of the specified index, the caller should notice the boundary of the Array.
func (*StrArray) InsertAfter ¶
InsertAfter inserts the <value> to the back of <index>.
func (*StrArray) InsertBefore ¶
InsertBefore inserts the <value> to the front of <index>.
func (*StrArray) Interfaces ¶
func (a *StrArray) Interfaces() []interface{}
Interfaces returns current Array as []interface{}.
func (*StrArray) IteratorAsc ¶
IteratorAsc iterates the Array in ascending order with given callback function <f>. If <f> returns true, then it continues iterating; or false to stop.
func (*StrArray) IteratorDesc ¶
IteratorDesc iterates the Array in descending order with given callback function <f>. If <f> returns true, then it continues iterating; or false to stop.
func (*StrArray) MarshalJSON ¶
MarshalJSON implements the interface MarshalJSON for json.Marshal.
func (*StrArray) Pad ¶
Pad pads Array to the specified length with <value>. If size is positive then the Array is padded on the right, or negative on the left. If the absolute value of <size> is less than or equal to the length of the Array then no padding takes place.
func (*StrArray) PushRight ¶
PushRight pushes one or multiple items to the end of Array. It equals to Append.
func (*StrArray) Range ¶
Range picks and returns items by range, like Array[start:end]. Notice, if in concurrent-safe usage, it returns a copy of slice; else a pointer to the underlying data.
If <end> is negative, then the offset will start from the end of Array. If <end> is omitted, then the sequence will have everything from start up until the end of the Array.
func (*StrArray) RemoveValue ¶
RemoveValue removes an item by value. It returns true if value is found in the Array, or else false if not found.
func (*StrArray) Replace ¶
Replace replaces the Array items by given <Array> from the beginning of Array.
func (*StrArray) Search ¶
Search searches Array by <value>, returns the index of <value>, or returns -1 if not exists.
func (*StrArray) Slice ¶
Slice returns the underlying data of Array. Note that, if it's in concurrent-safe usage, it returns a copy of underlying data, or else a pointer to the underlying data.
func (*StrArray) Sort ¶
Sort sorts the Array in increasing order. The parameter <reverse> controls whether sort in increasing order(default) or decreasing order
func (*StrArray) String ¶
String returns current Array as a string, which implements like json.Marshal does.
func (*StrArray) SubSlice ¶
SubSlice returns a slice of elements from the Array as specified by the <offset> and <size> parameters. If in concurrent safe usage, it returns a copy of the slice; else a pointer.
If offset is non-negative, the sequence will start at that offset in the Array. If offset is negative, the sequence will start that far from the end of the Array.
If length is given and is positive, then the sequence will have up to that many elements in it. If the Array is shorter than the length, then only the available Array elements will be present. If length is given and is negative then the sequence will stop that many elements from the end of the Array. If it is omitted, then the sequence will have everything from offset up until the end of the Array.
Any possibility crossing the left border of Array, it will fail.
func (*StrArray) UnmarshalJSON ¶
UnmarshalJSON implements the interface UnmarshalJSON for json.Unmarshal.
func (*StrArray) UnmarshalValue ¶
UnmarshalValue is an interface implement which sets any type of value for Array.