PathHandle

package
v0.0.0-...-be7a3bd Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 24, 2023 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const Separator = string(filepath.Separator)

Variables

This section is empty.

Functions

func Bucket256AllocatedUseSha512

func Bucket256AllocatedUseSha512(fileBytes []byte) (hash string, mod string)

Bucket256AllocatedUseSha512 使用sha512作为hash算法为文件分配桶(256个桶下)

mod取自hash转换为可见字符串之后的值
 已优化 可以被内联

func DirExist

func DirExist(path string) (bool, error)

DirExist 目录是否存在

func FileExist

func FileExist(path string) (bool, error)

FileExist 文件是否存在

func KeepDirExist

func KeepDirExist(path string) error

KeepDirExist 确保某目录一定存在

func KeepDirsExist

func KeepDirsExist(paths ...string) error

KeepDirsExist 确保某些目录一定存在

func PathExist

func PathExist(path string) (bool, error)

PathExist 路径是否存在

func RunInTempDir

func RunInTempDir(f func(tmppath string) error) error

RunInTempDir 在缓存目录中工作

func URLToLocalDirPath

func URLToLocalDirPath(url string) string

URLToLocalDirPath uri转本地相对路径

func URLToLocalDirPathNoHost

func URLToLocalDirPathNoHost(url string) string

URLToLocalDirPathNoHost uri转本地相对路径不带域名

func UnifyPathBackLocalSeparator

func UnifyPathBackLocalSeparator(b []byte)

UnifyPathBackLocalSeparator 统一路径分隔符为当前系统斜杠

func UnifyPathBackSlashSeparator

func UnifyPathBackSlashSeparator(b []byte)

UnifyPathBackSlashSeparator 统一路径分隔符为反斜杠

func UnifyPathSlashSeparator

func UnifyPathSlashSeparator(b []byte)

UnifyPathSlashSeparator 统一路径分隔符为斜杠

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL