file

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Dec 24, 2022 License: GPL-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckExist

func CheckExist(src string) bool

CheckExist 检查文件是否存在

func FileCreate

func FileCreate(content *bytes.Buffer, name string) error

创建文件

func FileMonitoringById

func FileMonitoringById(ctx context.Context, filePth string, id string, group string, hookfn func(context.Context, string, string, []byte))

func GetCurrentPath

func GetCurrentPath() string

获取当前路径,比如:E:/abc/data/test

func GetExt

func GetExt(fileName string) string

GetExt 获取文件后缀

func GetFileSize

func GetFileSize(filename string) int64

获取文件大小

func GetType

func GetType(p string) (string, error)

GetType 获取文件类型

func IsNotExistMkDir

func IsNotExistMkDir(src string) error

IsNotExistMkDir 检查文件夹是否存在 如果不存在则新建文件夹

func PathCreate

func PathCreate(dir string) error

PathCreate 创建目录

Types

type File

type File struct {
	Size int64  `json:"size"`
	Path string `json:"path"`
	Name string `json:"name"`
	Type string `json:"type"`
}

func Upload

func Upload(c *gin.Context, path string) (*File, error)

type ReplaceHelper

type ReplaceHelper struct {
	Root    string //路径
	OldText string //需要替换的文本
	NewText string //新的文本
}

func (*ReplaceHelper) DoWrok

func (h *ReplaceHelper) DoWrok() error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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