gofile

package
v1.1.10 Latest Latest
Warning

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

Go to latest
Published: Jul 11, 2024 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	EL = "\n"
)

Variables

This section is empty.

Functions

func CopyFile

func CopyFile(src, dst string) error

复制文件

func CreateSavePath

func CreateSavePath(dst string, perm os.FileMode) error

func DIR

func DIR() string

目录名称

func Exist

func Exist(path string) (bool, error)

func FILE

func FILE() string

文件名

func GetFileHeaderMd5Name

func GetFileHeaderMd5Name(fileHeader *multipart.FileHeader) (string, error)

func GetFileList

func GetFileList(path string) []string

获取当前目录下所有文件

func LINE

func LINE() int

行号

func RemoveFile

func RemoveFile(file string) error

func SaveFile

func SaveFile(file *multipart.FileHeader, dst string) error

func Trace

func Trace(skip int) (arr []string)

追踪信息

func WriteToFile

func WriteToFile(filename string, b []byte) error

写文件,支持路径创建

Types

type FileUploadResult

type FileUploadResult struct {
	OriginalFile string
	FileName     string
}

func UploadFile

func UploadFile(assetsDir string, file *multipart.FileHeader) (*FileUploadResult, error)

上传file文件到assetsDir目录下,assetsDir 目录不存在则自动创建,返回存储位置

Jump to

Keyboard shortcuts

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