Documentation ¶
Index ¶
- Constants
- func CreateFile(path string) error
- func DelFile(path string)
- func FileIsExist(path string) bool
- func FileIsNotExist(path string) bool
- func FolderIsExist(path string) bool
- func FolderIsNotExist(path string) bool
- func GetFilesByRoot(root string) ([]string, error)
- func GetParamMap(url string, params map[string]string, header map[string]string) ([]byte, error)
- func HasPerm(path string, perm os.FileMode)
- func MapToJsonFormatString(i map[string]interface{}) (string, error)
- func MapToJsonStr(i map[string]interface{}) string
- func Post(url string, params map[string]string, header map[string]string) ([]byte, error)
- func PrintMapJsonStr(i map[string]interface{})
- func ReadCSVFlatMap[R any](filepath string, mapFn func([]string, int) []R) ([]R, error)
- func ReadCSVMap[R any](filepath string, mapFn func([]string, int) R) ([]R, error)
- func SimpleGet(url string, header map[string]string) ([]byte, error)
- func SimpleReadCSV(filepath string) ([][]string, error)
- func SimpleWriteCSV(filepath string, data [][]string) error
- func StrToStruct[T any](str string) (T, error)
- func StrToStructArr[T any](str string) ([]T, error)
- func StrToTime(timeStr, formatStr string) (time.Time, error)
- func StringIsEmpty(str string) bool
- func StringIsNotEmpty(str string) bool
- func TimeToStr(t time.Time, format string) string
- func WriteCSVMap[T any](filepath string, data []T, mapFn func(t T, i int) []string) error
Constants ¶
View Source
const ( YYYYMMDDHHMMSS = "20060102150405" DateOnly = "2006-01-02" TimeOnly = "15:04:05" DateTime = "2006-01-02 15:04:05" )
Variables ¶
This section is empty.
Functions ¶
func CreateFile ¶
func GetFilesByRoot ¶
GetFilesByRoot 获取指定目录下的所有文件
func GetParamMap ¶
func MapToJsonFormatString ¶
MapToJsonFormatString Map转换成Json格式的字符串
func MapToJsonStr ¶
MapToJsonStr 将Map转换成Json字符串,没有换行等格式化
func PrintMapJsonStr ¶
func PrintMapJsonStr(i map[string]interface{})
PrintMapJsonStr 将Map按照Json格式输出
func ReadCSVFlatMap ¶
ReadCSVFlatMap 读取CSV文件,将处理函数中返回的数组扁平化处理
func ReadCSVMap ¶
ReadCSVMap 读取CSV文件,并调用处理函数,将结果置换成结构体
func SimpleReadCSV ¶
SimpleReadCSV 基础读取CSV文件
func SimpleWriteCSV ¶
func StrToStruct ¶
func StrToStructArr ¶
func StringIsEmpty ¶
func StringIsNotEmpty ¶
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.