fs

package
v0.3.7 Latest Latest
Warning

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

Go to latest
Published: Dec 25, 2024 License: MIT, Apache-2.0 Imports: 11 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckSize

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

func GetExt

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

func GetSize

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 Fs added in v0.3.3

type Fs = http.FileSystem

type ResponseFile added in v0.3.7

type ResponseFile struct {
	Name string        `json:"name"`
	Body io.ReadCloser `json:"body,omitempty"`
}

func (*ResponseFile) Close added in v0.3.7

func (res *ResponseFile) Close() error

func (*ResponseFile) RespHeader added in v0.3.7

func (res *ResponseFile) RespHeader() map[string]string

func (*ResponseFile) StatusCode added in v0.3.7

func (res *ResponseFile) StatusCode() int

func (*ResponseFile) WriteTo added in v0.3.7

func (res *ResponseFile) WriteTo(writer io.Writer) (int64, error)

type ResponseFileWriteTo added in v0.3.7

type ResponseFileWriteTo struct {
	Name string              `json:"name"`
	Body httpi.WriteToCloser `json:"body,omitempty"`
}

func (*ResponseFileWriteTo) Close added in v0.3.7

func (res *ResponseFileWriteTo) Close() error

func (*ResponseFileWriteTo) RespHeader added in v0.3.7

func (res *ResponseFileWriteTo) RespHeader() map[string]string

func (*ResponseFileWriteTo) StatusCode added in v0.3.7

func (res *ResponseFileWriteTo) StatusCode() int

func (*ResponseFileWriteTo) WriteTo added in v0.3.7

func (res *ResponseFileWriteTo) WriteTo(writer io.Writer) (int64, error)

type UploadFile

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