env

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: May 3, 2023 License: AGPL-3.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetAbsPath

func GetAbsPath(tmpName, defaultName string) string

获取绝对路径 tmpName:绝对/相对路径,defaultName:默认路径

func GetDBFilePath

func GetDBFilePath() string

获取sqlite数据库文件路径(绝对路径)

func GetEnvUploadFileDir

func GetEnvUploadFileDir() string

获取上传目录路径(绝对路径)

func GetEnvUploadPreFix

func GetEnvUploadPreFix() string

获取上传目录路径(前缀)(用于路由配置上传路径)

func GetRel

func GetRel(basepath, targpath string) string

https://www.cnblogs.com/malukang/p/12907945.html GetRel(uploadDir,uploadFilePath) 获取相对路径

func GetUploadFileRouterPath

func GetUploadFileRouterPath(rootDir, filePath string) string

// 获取上传文件路径的路由地址(相对路径)

func GetUploadFileRouterPath(rootDir, filePath string) string {
	relPath, _ := filepath.Rel(rootDir, filePath)
	return path.Join(path.Base(rootDir), relPath)
}

获取上传文件路径的路由地址(相对路径)

func Getwd

func Getwd() string

获取程序运行目录相当于linux的pwd

Types

This section is empty.

Jump to

Keyboard shortcuts

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