paths

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Jan 9, 2024 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	RootPath = filepath.Join(ObtainRootPath(), "defsdata")

	// 二级目录
	Files = filepath.Join(RootPath, "files") // 文件目录
	DB    = filepath.Join(RootPath, "db")    // 数据库目录
	Logs  = filepath.Join(RootPath, "logs")  // 日志目录

	// 三级目录
	UploadPath     = filepath.Join(Files, "uploads")   // 上传目录
	SlicePath      = filepath.Join(Files, "slices")    // 切片目录
	DownloadPath   = filepath.Join(Files, "downloads") // 下载目录
	BusinessDbPath = filepath.Join(DB, "businessdbs")  // 业务db目录
)

路径管理器 TODO: 待优化

Functions

func DefaultDownloadPath

func DefaultDownloadPath() string

GetDefaultDownloadPath 返回操作系统的默认下载路径。 它假设用户使用的是操作系统的标准下载文件夹。

func DirExistsAndMkdirAll

func DirExistsAndMkdirAll(path string) error

检查路径是否存在并且是一个目录 不存在则创建目录路径和所有尚不存在的父级。

func IsGorunEnv

func IsGorunEnv() bool

是否go run运行环境

func ObtainRootPath

func ObtainRootPath() string

获取根目录

Types

This section is empty.

Jump to

Keyboard shortcuts

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