Documentation ¶
Index ¶
- Constants
- Variables
- func BytesMD5Hash(data []byte) string
- func IsNumber(text string) (decimal.Decimal, bool)
- func ListDirFiles(dirPath, suffix string) ([]string, error)
- func MakeExcelFp(data ...ExcelSheet) (*excelize.File, error)
- func MultiStringMD5Hash(data ...string) string
- func PathOk(path string) (bool, error)
- func ReadCSV(filepath string) ([][]string, error)
- func SafeMakeExcelFp(data ...ExcelSheet) (*excelize.File, error)
- func StringMD5Hash(data string) string
- func ValidFileUTF8(filepath string, checkLines int) (bool, error)
- type ExcelSheet
- type Level
- type RotateFileWriter
- type XLogger
Constants ¶
View Source
const ExcelMaxRowCount = 1048576
Excel单个sheet最多只能由1048576行,超出的行数据将保存到复制了名称的sheet
Variables ¶
View Source
var ExcelIllegalCharactersRe = regexp.MustCompile(`[\000-\010]|[\013-\014]|[\016-\037]`)
Functions ¶
func ListDirFiles ¶
获取目录下是所有文件的绝对路径(不含文件夹, 并且可以通过suffix过滤, 当suffix为空字符串或者"*"时表示配匹所有文件尾缀)
func MakeExcelFp ¶
func MakeExcelFp(data ...ExcelSheet) (*excelize.File, error)
func MultiStringMD5Hash ¶
Get the MD5 hash value of multi string
func SafeMakeExcelFp ¶
func SafeMakeExcelFp(data ...ExcelSheet) (*excelize.File, error)
Types ¶
type ExcelSheet ¶
type ExcelSheet struct { Name string Content [][]interface{} // contains filtered or unexported fields }
func (*ExcelSheet) Len ¶
func (obj *ExcelSheet) Len() int
func (*ExcelSheet) Safe ¶
func (obj *ExcelSheet) Safe() []ExcelSheet
func (*ExcelSheet) SetSafeLimit ¶
func (obj *ExcelSheet) SetSafeLimit(n int)
type RotateFileWriter ¶
type RotateFileWriter struct {
// contains filtered or unexported fields
}
Custom rotate file writer.
func NewRotateFileWriter ¶
func NewRotateFileWriter(fileName, dirPath string, maxCount int, maxSize int64) *RotateFileWriter
循环文件写入器: fileName基本文件名, dirPath文件夹路径, maxCount最大文件数量, maxSize最大文件体积
func (*RotateFileWriter) Init ¶
func (obj *RotateFileWriter) Init()
Initial method, check whether the log dir existed and have history log files
Click to show internal directories.
Click to hide internal directories.