prepare

package
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: Sep 16, 2024 License: AGPL-3.0 Imports: 17 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

View Source
var NopChecker uploadClient.Checker = func(rs *uploadClient.Result, rd io.Reader) error {
	return nil
}

Functions

func IsInvalidUpload

func IsInvalidUpload(err error) bool

func NewClient

func NewClient(ctx echo.Context, ownerType string, ownerID uint64, clientName string, fileType string) uploadClient.Client

func NewClientWithModel

func NewClientWithModel(fileM *modelFile.File, clientName string, result *uploadClient.Result) uploadClient.Client

func NewClientWithResult

func NewClientWithResult(ctx echo.Context, ownerType string, ownerID uint64, clientName string, result *uploadClient.Result) uploadClient.Client

Types

type PrepareData

type PrepareData struct {
	StorerInfo storerUtils.Info
	DBSaver    dbsaver.DBSaver
	Checker    uploadClient.Checker
	Checkin    checker.Checker
	Subdir     string
	FileType   string
	// contains filtered or unexported fields
}

func NoCheckTokenPrepare

func NoCheckTokenPrepare(ctx echo.Context, subdir string, fileType string, storerInfos ...storerUtils.Info) (*PrepareData, error)

func Prepare

func Prepare(ctx echo.Context, subdir string, fileType string, storerInfos ...storerUtils.Info) (*PrepareData, error)

Prepare 上传前的环境准备

func (*PrepareData) Close

func (p *PrepareData) Close() error

func (*PrepareData) IsInvalidUpload

func (p *PrepareData) IsInvalidUpload(err error) bool

func (*PrepareData) MakeCallback

func (p *PrepareData) MakeCallback(fileM *modelFile.File, storer driver.Storer, subdir string) func(*uploadClient.Result, io.Reader, io.Reader) error

func (*PrepareData) MakeModel

func (p *PrepareData) MakeModel(ownerType string, ownerID uint64) *modelFile.File

func (*PrepareData) MakeUploader

func (p *PrepareData) MakeUploader(ownerType string, ownerID uint64, clientName string) func(fieldName string, fileType uploadClient.FileType, multiple bool) ([]*uploadClient.Result, error)

func (*PrepareData) Multiple

func (p *PrepareData) Multiple() bool

func (*PrepareData) NewStorer

func (p *PrepareData) NewStorer(subdir string) (driver.Storer, error)

func (*PrepareData) Save

func (p *PrepareData) Save(fileM *modelFile.File, clientName string, clients ...uploadClient.Client) (client uploadClient.Client, err error)

func (*PrepareData) SetMultiple

func (p *PrepareData) SetMultiple(multiple bool) *PrepareData

func (*PrepareData) Storer

func (p *PrepareData) Storer() (driver.Storer, error)

Jump to

Keyboard shortcuts

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