fs

package
v1.3.2 Latest Latest
Warning

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

Go to latest
Published: Jun 27, 2023 License: MIT Imports: 9 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckSize added in v1.1.0

func CheckSize(f multipart.File, uploadMaxSize int) bool

func GetExt added in v1.1.0

func GetExt(file *multipart.FileHeader) (string, error)

func GetSize added in v1.1.0

func GetSize(f multipart.File) int

Types

type File

type File struct {
	File http.File
	Name string
}

type FileInfo

type FileInfo struct {
	Binary []byte
	// contains filtered or unexported fields
}

func FetchFile

func FetchFile(r *http.Request) (*FileInfo, error)

func (*FileInfo) IsDir

func (f *FileInfo) IsDir() bool

func (*FileInfo) ModTime

func (f *FileInfo) ModTime() time.Time

func (*FileInfo) Mode

func (f *FileInfo) Mode() fs.FileMode

func (*FileInfo) Name

func (f *FileInfo) Name() string

func (*FileInfo) Size

func (f *FileInfo) Size() int64

func (*FileInfo) Sys

func (f *FileInfo) Sys() any

type FileInterface

type FileInterface interface {
	io.Reader
	Name() string
}

type UploadFile added in v1.1.0

type UploadFile struct {
	ID           uint64 `gorm:"primary_key" json:"id"`
	FileName     string `gorm:"type:varchar(100);not null" json:"file_name"`
	OriginalName string `gorm:"type:varchar(100);not null" json:"original_name"`
	URL          string `json:"url"`
	MD5          string `gorm:"type:varchar(32)" json:"md5"`
	Mime         string `json:"mime"`
	Size         uint64 `json:"size"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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