Documentation ¶
Index ¶
- Constants
- func NewPool() *workerPool
- type Browser
- type Bytes
- type Charset
- type Command
- func (obj *Command) Exec(commName string, arg ...string) (string, error)
- func (obj *Command) ExecGrep(commName string, arg ...string) (string, error)
- func (obj *Command) ExecPipe(commName string, arg ...string) error
- func (*Command) FlagBool(name string, value bool, usage string) bool
- func (*Command) FlagFloat64(name string, value int64, usage string) float64
- func (*Command) FlagInt(name string, value int, usage string) int
- func (*Command) FlagInt64(name string, value int64, usage string) int64
- func (*Command) FlagString(name, value, usage string) string
- type File
- func (*File) AppendWriteFile(filePath string, body []byte) (writerLen int, err error)
- func (*File) CreateFile(filePath string, body []byte) (writerLen int64, err error)
- func (obj *File) CreateFileByNot(filePath string) error
- func (*File) FileSize(file string) int64
- func (*File) IsBinary(content string) bool
- func (*File) IsExist(path string) bool
- func (*File) ReadAll(fielPath string) ([]byte, error)
- func (*File) ReadAllOnLine(fielPath string, callBak func(row string) bool)
- func (*File) ReadOnLine(fielPath string, callBak func(row string) bool)
- func (File) WriteFileSafer(writePath string, data []byte, perm os.FileMode) error
- type Folder
- func (*Folder) IsDir(path string) bool
- func (*Folder) ReadDirs(dir string) ([]string, error)
- func (*Folder) ReadFiles(dir string) (fileList []os.FileInfo, err error)
- func (*Folder) ReadFilesByOrderNum(dir string) (fileList []string, err error)
- func (*Folder) ReadFilesToStr(dir string) (fileList []string, err error)
- type Grab
- type Http
- func (obj *Http) DownloadFile(url, savePath string) (string, error)
- func (obj *Http) Get(url string, data map[string]interface{}, header map[string]string) ([]byte, error)
- func (*Http) GetUrlBody(url string) ([]byte, error)
- func (*Http) GetUrlRedirect(url string) (*url.URL, error)
- func (obj *Http) Post(url string, data map[string]interface{}, header map[string]string) ([]byte, error)
- func (obj *Http) Request(method, requestUrl string, data map[string]interface{}, ...) ([]byte, error)
- type Json
- type Map
- func (*Map) Int64BoolToKeys(req map[int64]bool) (res []int64)
- func (*Map) Int64Int64ToKeys(req map[int64]int64) (res []int64)
- func (*Map) Int64Int64ToValues(req map[int64]int64) (res []int64)
- func (*Map) Int64StrToKeys(req map[int64]string) (res []int64)
- func (*Map) Int64StrToValues(req map[int64]string) (res []string)
- func (*Map) IntBoolToKeys(req map[int]bool) (res []int)
- func (*Map) IntIntToKeys(req map[int]int) (res []int)
- func (*Map) IntIntToValues(req map[int]int) (res []int)
- func (*Map) IntStrToKeys(req map[int]string) (res []int)
- func (*Map) IntStrToValues(req map[int]string) (res []string)
- func (*Map) StrBoolToKeys(req map[string]bool) (res []string)
- func (*Map) StrInt64ToKeys(req map[string]int64) (res []string)
- func (*Map) StrInt64ToValues(req map[string]int64) (res []int64)
- func (*Map) StrIntToKeys(req map[string]int) (res []string)
- func (*Map) StrIntToValues(req map[string]int) (res []int)
- func (*Map) StrStrToKeys(req map[string]string) (res []string)
- func (*Map) StrStrToValues(req map[string]string) (res []string)
- type Net
- type Num
- func (*Num) FloatDecimal(num float64) float64
- func (*Num) FloatToInt64(num float64, retain int) int64
- func (*Num) FloatToStr(f float64) string
- func (*Num) Int64ToDateStr(i int64) string
- func (*Num) Int64ToFloat64(num int64, retain int) float64
- func (*Num) Int64ToStr(i int64) string
- func (*Num) Int64ToTimeStr(i int64) string
- func (*Num) IntToStr(i int) string
- func (*Num) MaxFloat(a, b float64) float64
- func (*Num) MaxInt(a, b int) int
- func (*Num) MaxInt64(a, b int64) int64
- func (*Num) MinFloat(a, b float64) float64
- func (*Num) MinInt(a, b int) int
- func (*Num) MinInt64(a, b int64) int64
- type OS
- type Rand
- type Slice
- func (*Slice) Int64ToMap(req []int64) (res map[int64]bool)
- func (*Slice) Int64ToSql(req []int64) (query []string, args []int64)
- func (*Slice) Int64ToStr(req []int64) (res []string)
- func (*Slice) IntToMap(req []int) (res map[int]bool)
- func (*Slice) IntToSql(req []int) (query []string, args []int)
- func (*Slice) IntToStr(req []int) (res []string)
- func (*Slice) StrToInt64(req []string) (res []int64)
- func (*Slice) StrToMap(req []string) (res map[string]bool)
- func (*Slice) StrToSql(req []string) (query, args []string)
- type Str
- func (*Str) Contains(str string, strs []string) bool
- func (*Str) EncloseIgnoreCase(text, open, close string, searchStrs ...string) string
- func (*Str) PYSort(strArr []string) []string
- func (*Str) ReplaceEmpty(str string, rep ...string) string
- func (*Str) ReplaceIgnoreCase(text, searchStr, repl string) string
- func (*Str) ReplaceRegexpStrEmpty(str string, math ...string) string
- func (*Str) ReplacesIgnoreCase(text string, searchStrRepl ...string) string
- func (*Str) SplitByNum(txt string, length int) []string
- func (*Str) SubStr(str string, length int) string
- func (*Str) ToBytes(s string) []byte
- func (obj *Str) ToDateStr(t string) (string, error)
- func (*Str) ToFloat64(s string) (float64, error)
- func (*Str) ToInt(s string) (int, error)
- func (*Str) ToInt64(s string) (int64, error)
- func (*Str) ToTime(s string) (time.Time, error)
- func (obj *Str) ToTimeStr(s string) (string, error)
- type Time
Constants ¶
View Source
const ( UTF8 = Charset("UTF-8") GB18030 = Charset("GB18030") )
View Source
const ( POST = "POST" GET = "GET" )
View Source
const LayoutDate = "2006-01-02"
View Source
const LayoutTime = "2006-01-02 15:04:05"
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Command ¶
type Command struct { }
func (*Command) FlagFloat64 ¶
解析命令行int64参数
func (*Command) FlagString ¶
解析命令行字符串参数
type File ¶
type File struct { }
func (*File) AppendWriteFile ¶
追加写入
func (*File) CreateFile ¶
覆盖写入文件
func (*File) CreateFileByNot ¶
如果文件夹不存在,则递归创建文件夹
func (*File) ReadAllOnLine ¶
一次性加载文件,按行读取
func (*File) ReadOnLine ¶
逐行读取文件
type Folder ¶
type Folder struct { }
func (*Folder) ReadFilesByOrderNum ¶
读取目录文件并按文件名中的数字排序
type Grab ¶
type Grab struct { }
type Http ¶
type Http struct { }
func (*Http) DownloadFile ¶
* 下载文件 url:下载地址 savePath:保存路径(包含文件名)
func (*Http) Get ¶
func (obj *Http) Get(url string, data map[string]interface{}, header map[string]string) ([]byte, error)
http get请求
func (*Http) GetUrlRedirect ¶
* 获取Url地址重写向地址
type Json ¶
type Json struct { }
func (*Json) MarshalIndentJSON ¶
func (*Json) MarshalJSON ¶
func (*Json) UnmarshalJSON ¶
type Num ¶
type Num struct { }
func (*Num) FloatToInt64 ¶
* num: 数字 retain:保留位数,精度
func (*Num) FloatToStr ¶
float转字符串 'b' (-ddddp±ddd,二进制指数) 'e' (-d.dddde±dd,十进制指数) 'E' (-d.ddddE±dd,十进制指数) 'f' (-ddd.dddd,没有指数) 'g' ('e':大指数,'f':其它情况) 'G' ('E':大指数,'f':其它情况)
func (*Num) Int64ToFloat64 ¶
* num: 数字 retain:保留位数,精度
type Str ¶
type Str struct { }
func (*Str) EncloseIgnoreCase ¶
Enclose encloses search strings with open and close, case-insensitively.
func (*Str) ReplaceIgnoreCase ¶
ReplaceIgnoreCase replace searchStr with repl in the text, case-insensitively.
func (*Str) ReplaceRegexpStrEmpty ¶
字符串正则替换
func (*Str) ReplacesIgnoreCase ¶
ReplacesIgnoreCase replace searchStr-repl pairs in the text, case-insensitively.
Click to show internal directories.
Click to hide internal directories.