Documentation
¶
Index ¶
- func CheckSHA(reader io.Reader, sha string) error
- func CheckSHA256(reader io.Reader, sha string) error
- func Copy(src, dst string) error
- func FmtVer(ver string) (string, error)
- func GetFreePort(host string, priority int) (int, error)
- func IsEmptyDir(path string) (bool, error)
- func IsExist(path string) bool
- func IsNotExist(path string) bool
- func Move(src, dst string) error
- func MustGetFreePort(host string, priority int) int
- func RebuildArgs(args []string) []string
- func Untar(reader io.Reader, to string) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CheckSHA ¶ added in v1.0.0
CheckSHA returns error if the hash of reader content mismatches `sha`
func CheckSHA256 ¶ added in v1.0.0
CheckSHA256 returns an error if the hash of reader mismatches `sha`
func FmtVer ¶
FmtVer converts a version string to SemVer format, if the string is not a valid SemVer and fails to parse and convert it, an error is raised.
func GetFreePort ¶
GetFreePort asks the kernel for a free open port that is ready to use.
func IsEmptyDir ¶ added in v1.0.0
IsEmptyDir check whether a path is an empty directory
func Move ¶ added in v1.0.0
Move moves a file from src to dst, this is done by copying the file and then delete the old one. Use os.Rename() to rename file within the same filesystem instead this, it's more lightweight but can not be used across devices.
func MustGetFreePort ¶
MustGetFreePort asks the kernel for a free open port that is ready to use, if fail, panic
func RebuildArgs ¶ added in v1.0.0
RebuildArgs move "--help" or "-h" flag to the end of the arg list
Types ¶
This section is empty.