upload

package
v1.0.1006 Latest Latest
Warning

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

Go to latest
Published: Apr 27, 2024 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Fileinfo

type Fileinfo struct {
	// contains filtered or unexported fields
}

*

  • 文件信息 *
  • @create 2021-8-15
  • @author deatil

func NewFileinfo

func NewFileinfo() *Fileinfo

文件信息

func (*Fileinfo) CloseFile

func (this *Fileinfo) CloseFile()

关闭文件流

func (*Fileinfo) GetExtension

func (this *Fileinfo) GetExtension() string

后缀

func (*Fileinfo) GetFile

func (this *Fileinfo) GetFile() multipart.File

获取文件流

func (*Fileinfo) GetFileHeader

func (this *Fileinfo) GetFileHeader() *multipart.FileHeader

获取文件

func (*Fileinfo) GetFileType

func (this *Fileinfo) GetFileType() string

文件大类

func (*Fileinfo) GetFiletypes

func (this *Fileinfo) GetFiletypes() map[string]string

获取文件类型

func (*Fileinfo) GetMd5

func (this *Fileinfo) GetMd5() string

MD5 摘要

func (*Fileinfo) GetMimeType

func (this *Fileinfo) GetMimeType() string

mime

func (*Fileinfo) GetOriginalFilename

func (this *Fileinfo) GetOriginalFilename() string

原始文件名

func (*Fileinfo) GetOriginalName

func (this *Fileinfo) GetOriginalName() string

原始名称

func (*Fileinfo) GetSha1

func (this *Fileinfo) GetSha1() string

sha1 摘要

func (*Fileinfo) GetSize

func (this *Fileinfo) GetSize() int64

大小

func (*Fileinfo) WithFile

func (this *Fileinfo) WithFile(file *multipart.FileHeader) *Fileinfo

设置文件流

func (*Fileinfo) WithFiletypes

func (this *Fileinfo) WithFiletypes(filetypes map[string]string) *Fileinfo

设置文件类型

type OpenFileinfo

type OpenFileinfo struct {
	// contains filtered or unexported fields
}

*

  • 文件信息 *
  • @create 2021-9-29
  • @author deatil

func NewOpenFileinfo

func NewOpenFileinfo() *OpenFileinfo

文件信息

func (*OpenFileinfo) CloseFile

func (this *OpenFileinfo) CloseFile()

关闭文件流

func (*OpenFileinfo) GetExtension

func (this *OpenFileinfo) GetExtension() string

后缀

func (*OpenFileinfo) GetFile

func (this *OpenFileinfo) GetFile() *os.File

获取文件流

func (*OpenFileinfo) GetFileName

func (this *OpenFileinfo) GetFileName() string

获取文件流

func (*OpenFileinfo) GetFileType

func (this *OpenFileinfo) GetFileType() string

文件大类

func (*OpenFileinfo) GetFiletypes

func (this *OpenFileinfo) GetFiletypes() map[string]string

获取文件类型

func (*OpenFileinfo) GetMd5

func (this *OpenFileinfo) GetMd5() string

MD5 摘要

func (*OpenFileinfo) GetMimeType

func (this *OpenFileinfo) GetMimeType() string

mime

func (*OpenFileinfo) GetOriginalFilename

func (this *OpenFileinfo) GetOriginalFilename() string

原始文件名

func (*OpenFileinfo) GetOriginalName

func (this *OpenFileinfo) GetOriginalName() string

原始名称

func (*OpenFileinfo) GetSha1

func (this *OpenFileinfo) GetSha1() string

sha1 摘要

func (*OpenFileinfo) GetSize

func (this *OpenFileinfo) GetSize() int64

大小

func (*OpenFileinfo) String

func (this *OpenFileinfo) String() string

字符

func (*OpenFileinfo) WithFile

func (this *OpenFileinfo) WithFile(file *os.File) *OpenFileinfo

设置文件流

func (*OpenFileinfo) WithFileName

func (this *OpenFileinfo) WithFileName(fileName string) *OpenFileinfo

设置文件流

func (*OpenFileinfo) WithFiletypes

func (this *OpenFileinfo) WithFiletypes(filetypes map[string]string) *OpenFileinfo

设置文件类型

type Rename

type Rename struct {
	// contains filtered or unexported fields
}

*

  • 重命名 *
  • @create 2021-8-15
  • @author deatil

func NewRename

func NewRename() *Rename

重命名

func (*Rename) DatetimeName

func (this *Rename) DatetimeName() *Rename

datetimeName 命名文件名

func (*Rename) GenerateClientName

func (this *Rename) GenerateClientName() string

原始命名

func (*Rename) GenerateDatetimeName

func (this *Rename) GenerateDatetimeName() string

时间命名

func (*Rename) GenerateSequenceName

func (this *Rename) GenerateSequenceName() string

sequence 命名

func (*Rename) GenerateUniqueName

func (this *Rename) GenerateUniqueName() string

唯一命名

func (*Rename) GetDefaultExtension

func (this *Rename) GetDefaultExtension() string

获取默认的后缀

func (*Rename) GetDefaultName

func (this *Rename) GetDefaultName() string

获取默认的命名

func (*Rename) GetName

func (this *Rename) GetName() any

获取文件名

func (*Rename) GetStoreName

func (this *Rename) GetStoreName() string

获取最后存储名称

func (*Rename) SequenceName

func (this *Rename) SequenceName() *Rename

sequenceName 命名文件名

func (*Rename) UniqueName

func (this *Rename) UniqueName() *Rename

UniqueName 命名文件名

func (*Rename) WithCheckFileExistsFunc

func (this *Rename) WithCheckFileExistsFunc(f func(string) bool) *Rename

设置文件存在检测函数

func (*Rename) WithDefaultName

func (this *Rename) WithDefaultName(name string) *Rename

设置默认的命名

func (*Rename) WithFileName

func (this *Rename) WithFileName(filename string) *Rename

设置文件名带后缀

func (*Rename) WithName

func (this *Rename) WithName(name string) *Rename

设置文件名

func (*Rename) WithdDefaultExtension

func (this *Rename) WithdDefaultExtension(ext string) *Rename

设置默认的后缀

type Upload

type Upload struct {
	// contains filtered or unexported fields
}

*

  • 上传 *
  • @create 2021-8-15
  • @author deatil

func New

func New() *Upload

上传

func (*Upload) Destroy

func (this *Upload) Destroy(path string) bool

删除

func (*Upload) EnsureDir

func (this *Upload) EnsureDir(path string) bool

创建文件夹

func (*Upload) GetDir

func (this *Upload) GetDir() any

获取文件夹

func (*Upload) GetDirectory

func (this *Upload) GetDirectory() string

设置的文件夹

func (*Upload) GetFileinfo

func (this *Upload) GetFileinfo() *Fileinfo

获取文件信息

func (*Upload) GetObjectUrl

func (this *Upload) GetObjectUrl(path string) string

对外链接

func (*Upload) GetOpenFileinfo

func (this *Upload) GetOpenFileinfo() *OpenFileinfo

获取文件信息2

func (*Upload) GetRealname

func (this *Upload) GetRealname(name string) string

最后文件名

func (*Upload) GetRename

func (this *Upload) GetRename() *Rename

获取重命名

func (*Upload) GetStorage

func (this *Upload) GetStorage() *storage.Storage

获取文件系统

func (*Upload) IfExists

func (this *Upload) IfExists(realname string) bool

如果存在重命名

func (*Upload) SaveContents

func (this *Upload) SaveContents(contents string, name string) string

保存文本信息

func (*Upload) SaveFile

func (this *Upload) SaveFile(file *multipart.FileHeader) string

保存上传的文件

func (*Upload) SaveOpenedFile

func (this *Upload) SaveOpenedFile(file *os.File) string

保存打开的文件

func (*Upload) SaveUploadedFile

func (this *Upload) SaveUploadedFile(file *multipart.FileHeader) string

上传文件保存

func (*Upload) WithDir

func (this *Upload) WithDir(directory string) *Upload

设置文件夹

func (*Upload) WithFileinfo

func (this *Upload) WithFileinfo(fileinfo *Fileinfo) *Upload

设置文件信息

func (*Upload) WithOpenFileinfo

func (this *Upload) WithOpenFileinfo(fileinfo *OpenFileinfo) *Upload

设置文件信息2

func (*Upload) WithPermission

func (this *Upload) WithPermission(permission string) *Upload

设置权限

func (*Upload) WithRename

func (this *Upload) WithRename(rename *Rename) *Upload

设置重命名

func (*Upload) WithStorage

func (this *Upload) WithStorage(storager *storage.Storage) *Upload

设置文件系统

Jump to

Keyboard shortcuts

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