Documentation ¶
Index ¶
- Constants
- Variables
- func CheckPath(paths ...string) error
- func Convert[F pkg.File](loader func() ([]F, error)) (files []fs.FileInfo, err error)
- func IsFastFile(name string) bool
- func IsNetFile(name string) bool
- func IsSystem(parent, name string) bool
- func IsSystemDir(file pkg.File) bool
- func NewFastFile(parentId, url string) pkg.Upload
- func NewLocalFile(parentId string, path string) pkg.Upload
- func NewURLFile(parentId, link string) pkg.Upload
- func NewWebFile(parentId, name string, data *http.Request) pkg.Upload
- func ReadableFileInfo(info os.FileInfo) string
- func ReadableSize(size uint64) string
- func Rel(parent, file string) string
- type FastFile
- func (f *FastFile) FileMD5() string
- func (f *FastFile) LazyCheck() bool
- func (f *FastFile) Name() string
- func (f *FastFile) Overwrite() bool
- func (f *FastFile) ParentId() string
- func (f *FastFile) Part(int64) pkg.UploadPart
- func (f *FastFile) Size() int64
- func (f *FastFile) SliceMD5() string
- func (f *FastFile) SliceNum() int
- type FileInfo
- func (f *FileInfo) ContentType(ctx context.Context) (string, error)
- func (f *FileInfo) ETag(ctx context.Context) (string, error)
- func (f *FileInfo) Id() string
- func (f *FileInfo) Info() (fs.FileInfo, error)
- func (f *FileInfo) IsDir() bool
- func (f *FileInfo) ModTime() time.Time
- func (f *FileInfo) Mode() os.FileMode
- func (f *FileInfo) Name() string
- func (f *FileInfo) PId() string
- func (f *FileInfo) Size() int64
- func (f *FileInfo) Sys() interface{}
- type FilePart
- type FileType
- type LocalFile
- func (f *LocalFile) Close()
- func (f *LocalFile) FileMD5() string
- func (f *LocalFile) LazyCheck() bool
- func (f *LocalFile) Name() string
- func (f *LocalFile) Overwrite() bool
- func (f *LocalFile) ParentId() string
- func (f *LocalFile) Part(num int64) pkg.UploadPart
- func (f *LocalFile) Size() int64
- func (f *LocalFile) SliceMD5() string
- func (f *LocalFile) SliceNum() int
- type MediaType
- type ModTime
- type NetFile
- func (f *NetFile) FileMD5() string
- func (f *NetFile) LazyCheck() bool
- func (f *NetFile) Name() string
- func (f *NetFile) Overwrite() bool
- func (f *NetFile) ParentId() string
- func (f *NetFile) Part(i int64) pkg.UploadPart
- func (f *NetFile) Size() int64
- func (f *NetFile) SliceMD5() string
- func (f *NetFile) SliceNum() int
Constants ¶
View Source
const ( KB = 1 << 10 MB = 1 << 20 GB = 1 << 30 TB = 1 << 40 Slice = 10 * MB )
Variables ¶
View Source
var Root = &sysFolder{FileId: "-11", FileName: "全部文件"}
Functions ¶
func IsFastFile ¶ added in v0.6.0
func IsSystemDir ¶
func NewFastFile ¶ added in v0.6.0
func NewURLFile ¶ added in v0.6.0
func NewWebFile ¶ added in v0.6.0
func ReadableFileInfo ¶
func ReadableSize ¶
Types ¶
type FileInfo ¶ added in v0.6.0
type FileInfo struct { IsFolder bool ParentId json.Number FileId json.Number `json:"id,omitempty"` FileName string `json:"name,omitempty"` FileSize int64 `json:"size,omitempty"` MD5 string `json:"md5,omitempty"` FileModTime ModTime `json:"lastOpTime,omitempty"` }
func (*FileInfo) ContentType ¶ added in v0.6.0
type LocalFile ¶ added in v0.6.0
type LocalFile struct {
// contains filtered or unexported fields
}
type ModTime ¶ added in v0.6.0
func (*ModTime) UnmarshalJSON ¶ added in v0.6.0
Click to show internal directories.
Click to hide internal directories.