Documentation ¶
Index ¶
- func CopyFile(src string, dest string) (int64, error)
- func DeleteFiles(files []string)
- func FileExists(path string) bool
- func FindLogFiles(path string) ([]string, []string, error)
- func GetFieldNameByTag(s interface{}, tag, value string) string
- func GetOrElse(s string, def string) string
- func GetSystemDnsServer() string
- func IsDirectory(path string) (bool, error)
- func LookupIP(addr string, server string) (string, error)
- func Map2String(m map[string]string) string
- func Partition(s string, sep string) (string, string, string)
- func PruneByTag(in interface{}, value string, tag string) (interface{}, error)
- func ReadFileLines(path string) ([]string, error)
- func RenameFiles(old []string, new []string)
- func SplitExt(path string) (string, string)
- func String2Map(s string) map[string]string
- func ZipFiles(filename string, files []string) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DeleteFiles ¶
func DeleteFiles(files []string)
DeleteFiles removes the given file list ignoring errors
func FileExists ¶
FileExists checks whether the given path is a file
func FindLogFiles ¶
FindLogFiles returns the files and dates archived by date
func GetFieldNameByTag ¶
GetFieldNameByTag returns the field name of struct that match the given tag and value
func GetOrElse ¶ added in v1.7.1
GetOrElse returns the given string if it's non-empty, or returns the default string.
func GetSystemDnsServer ¶ added in v1.7.1
func GetSystemDnsServer() string
GetSystemDnsServer returns the dns server used by local system
func IsDirectory ¶ added in v1.8.0
IsDirectory determines if a file represented by `path` is a directory or not
func Map2String ¶
Map2String turns the map into string. The key value pairs are separated by equal sign. Each pair is separated by new line character.
func Partition ¶
Partition returns the left side of the separator, the separator and the right side of the separator.
func PruneByTag ¶
PruneByTag returns a copy of "in" that only contains fields with the given tag and value
func ReadFileLines ¶
ReadFileLines reads all lines in a file and returns a slice of string
func RenameFiles ¶
RenameFiles renames the given file list with new file list ignoring errors
func String2Map ¶
String2Map splits the string by new line character. Each line is partitioned by equal sign. The left side is the key while the right side is the value.
Types ¶
This section is empty.