Versions in this module Expand all Collapse all v0 v0.3.0 Jun 6, 2025 v0.2.2 May 22, 2025 v0.2.1 Apr 4, 2025 v0.2.0 Apr 4, 2025 Changes in this version + var MimeType = map[string]string + func DeleteFile(userType string, id uint64) + func IsExistsMimeAllow(value string, array []string) bool + func SaveFile(userType string, userId uint64, info Info) (id uint64, err error) + type Filesystem struct + func Instance() *Filesystem + func NewFilesystem(userType string, userId uint64) (*Filesystem, error) + func (filesystem *Filesystem) DeleteFile(filePath string) (bool, error) + func (filesystem *Filesystem) DeleteMultipleFile(filePath []string) (bool, error) + func (filesystem *Filesystem) DownloadNetworkFile(networkFileUrl, filePath string) error + func (filesystem *Filesystem) EditorUpload(fileBytes []byte, allow config.FileAllow, field, filename, mime, ext string) (Info, error) + func (filesystem *Filesystem) FullPath(filePath string) string + func (filesystem *Filesystem) HasDir(file string) bool + func (filesystem *Filesystem) HasFile(filePath string) bool + func (filesystem *Filesystem) MkDir(dir string, mode os.FileMode) (bool, error) + func (filesystem *Filesystem) NetworkFileSaveObject(networkFileUrl, filePath, mime string) (bool, error) + func (filesystem *Filesystem) OriginalPath(filePath string) string + func (filesystem *Filesystem) SaveFile(dstFile string, srcFile io.Reader, mimeType string) (bool, error) + func (filesystem *Filesystem) Storage() adapter.Adapter + func (filesystem *Filesystem) Upload(file *multipart.FileHeader, allow config.FileAllow, field string) (Info, error) + type Info struct + Attach string + Code int + Ext string + FileMd5 string + FileSize uint64 + Filename string + Height uint64 + Id uint64 + IsImage uint8 + MimeType string + Path string + Sha1 string + Width uint64 + func FileExists(userType, userId string, sha1 string, md5 string) (Info, error) + type Size interface + Size func() int64 + type Stat interface + Stat func() (os.FileInfo, error) + type Uploader struct + func NewUploader(storage adapter.Adapter, allow config.FileAllow, field string) *Uploader + func (uploader *Uploader) EditorUpload(userType string, userId uint64, fileBytes []byte, filename, mime, ext string) (Info, error) + func (uploader *Uploader) HasFile(filePath string) bool + func (uploader *Uploader) Upload(userType string, fileHeader *multipart.FileHeader) (Info, error) v0.1.0 Nov 24, 2024