Documentation
¶
Index ¶
- func Array2File(fileName, sep string, array []string)
- func CheckAFAllLowThen(item map[string]string, AFList []string, threshold float64, includeEqual bool) bool
- func CheckErr(err error, msg ...string)
- func CopyFile(dst, src string) (err error)
- func DeferClose(h handle)
- func DownloadFile(filepath, url string) error
- func DownloadFileProgress(filepath, url string)
- func Encode2File(file *os.File, data, codeKey []byte) int
- func Encode2file(fileName string, data, codeKey []byte)
- func File2Array(fileName string) []string
- func File2Decode(fileName string, codeKey []byte) []byte
- func File2Map(fileName, sep string, override bool) (db map[string]string, err error)
- func File2MapArray(fileName, sep string, skip *regexp.Regexp) ([]map[string]string, []string)
- func File2MapMap(fileName, key, sep string) map[string]map[string]string
- func File2MapMapMerge(fileName, key, sep, merge string) map[string]map[string]string
- func File2Slice(fileName, sep string) [][]string
- func FileExists(fileName string) bool
- func Files2Map(fileNames, sep string, override bool) (db map[string]string, err error)
- func Files2MapArray(fileNames []string, sep string, skip *regexp.Regexp) (Data []map[string]string, Title []string)
- func FormatWidth(width int, str string, fill byte) string
- func Gz2Array(fileName string) []string
- func Gz2MapArray(fileName, sep string, skip *regexp.Regexp) ([]map[string]string, []string)
- func Gz2MapMap(fileName, key, sep string) map[string]map[string]string
- func Gz2Slice(fileName, sep string) [][]string
- func Json2File(fileName string, a interface{}) error
- func Json2Map(jsonBlob []byte) map[string]string
- func Json2MapBool(jsonBlob []byte) map[string]bool
- func Json2MapInt(jsonBlob []byte) map[string]int
- func Json2MapMap(jsonBlob []byte) map[string]map[string]string
- func Json2file(json []byte, filenName string) error
- func Json2rawFile(fileName string, a interface{}) error
- func JsonFile2Data(fileName string, v interface{})
- func JsonFile2Interface(fileName string) interface{}
- func JsonFile2Map(fileName string) map[string]string
- func JsonFile2MapBool(fileName string) map[string]bool
- func JsonFile2MapInt(fileName string) map[string]int
- func JsonFile2MapMap(fileName string) map[string]map[string]string
- func JsonIndent(v interface{}, prefix, indent string) (b []byte, err error)
- func LongFile2MapArray(fileName, sep string, skip *regexp.Regexp) (mapArray []map[string]string, title []string)
- func LongFiles2MapArray(fileNames []string, sep string, skip *regexp.Regexp) (Data []map[string]string, Title []string)
- func MemProfile(memProfile string)
- func ParallelRun(cmds [][]string, threshold int, tag string) (ok bool)
- func Reader2MapArray(reader *bufio.Reader, sep string, skip *regexp.Regexp) (mapArray []map[string]string, title []string)
- func RunCmd(name string, args ...string) error
- func RunTask(c <-chan bool, cmd []string, task string, index int, ok *bool)
- func SGEsubmit(cmds []string, hjid string, submitArgs []string) string
- func ScanTitle(scanner *bufio.Scanner, sep string, skip *regexp.Regexp) (title []string)
- func Scanner2Array(scanner *bufio.Scanner) []string
- func Scanner2MapArray(scanner *bufio.Scanner, sep string, skip *regexp.Regexp) ([]map[string]string, []string)
- func Scanner2MapMap(scanner *bufio.Scanner, key, sep string) map[string]map[string]string
- func Scanner2Slice(scanner *bufio.Scanner, sep string) [][]string
- func Sheet2MapArray(excelFile, sheetName string) ([]string, []map[string]string)
- func Sheet2MapMap(excelFile, sheetName, key string) ([]string, map[string]map[string]string)
- func Sheet2MapMapMerge(excelFile, sheetName, key, sep string) ([]string, map[string]map[string]string)
- func Sheet2MapMapMergeReplace(excelFile, sheetName, key, sep, replace string) ([]string, map[string]map[string]string)
- func Sheet2MapMapMergeTrim(excelFile, sheetName, key, sep string) ([]string, map[string]map[string]string)
- func Slice2MapArray(slice [][]string) ([]string, []map[string]string)
- func Slice2MapMap(slice [][]string, key string) ([]string, map[string]map[string]string)
- func Slice2MapMapMerge(slice [][]string, key, sep string) ([]string, map[string]map[string]string)
- func Slice2MapMapMergeReplace(slice [][]string, key, sep, replace string) ([]string, map[string]map[string]string)
- func Slice2MapMapMergeTrim(slice [][]string, key, sep string) ([]string, map[string]map[string]string)
- func Submit(script, hjid string, submitArgs, args []string) (jid string)
- func Symlink(source, dest string) error
- type MapDb
- type WriterCounter
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CheckAFAllLowThen ¶
func DownloadFile ¶
From https://golangcode.com/download-a-file-from-a-url/ DownloadFile will download a url to a local file. It's efficient because it will write as it downloads and not load the whole file into memroy.
func DownloadFileProgress ¶
func DownloadFileProgress(filepath, url string)
We pass an io.TeeReader into Copy() to report progress on the download.
func Encode2file ¶
func File2Decode ¶
func File2MapArray ¶
read file to []map[string]string
func File2MapMap ¶
read file to map[string]map[string]string
func File2MapMapMerge ¶
read file to map[string]map[string]string
func FileExists ¶
check if a file exists an is not a directory
func Files2MapArray ¶
func Files2MapArray(fileNames []string, sep string, skip *regexp.Regexp) (Data []map[string]string, Title []string)
read files to []map[string]string
func FormatWidth ¶
try to convert string to given width
func Gz2MapArray ¶
func Json2MapBool ¶
func Json2MapInt ¶
func Json2rawFile ¶
func JsonFile2Data ¶
func JsonFile2Data(fileName string, v interface{})
func JsonFile2Interface ¶
func JsonFile2Interface(fileName string) interface{}
func JsonFile2Map ¶
func JsonFile2MapBool ¶
func JsonFile2MapInt ¶
func JsonIndent ¶
warpper of json.MarshalIndent
func LongFile2MapArray ¶
func LongFile2MapArray(fileName, sep string, skip *regexp.Regexp) (mapArray []map[string]string, title []string)
read file with long line to []map[string]string
func LongFiles2MapArray ¶
func LongFiles2MapArray(fileNames []string, sep string, skip *regexp.Regexp) (Data []map[string]string, Title []string)
read files to []map[string]string
func MemProfile ¶
func MemProfile(memProfile string)
func Reader2MapArray ¶
func Scanner2Array ¶
func Scanner2MapArray ¶
func Scanner2MapMap ¶
func Sheet2MapArray ¶
func Sheet2MapMap ¶
func Sheet2MapMapMerge ¶
func Sheet2MapMapMergeTrim ¶
func Slice2MapMap ¶
func Slice2MapMapMerge ¶
func Slice2MapMapMergeTrim ¶
Types ¶
type WriterCounter ¶
type WriterCounter struct {
Total uint64
}
From https://golangcode.com/download-a-file-with-progress/ WriterCounter counts the number of bytes written to it. It implements to the io.Writer interface and we can pass this into io.TeeReader() which will report progress on each write cycle.
func (*WriterCounter) PrintProgress ¶
func (wc *WriterCounter) PrintProgress()