goadmin

package
v0.0.0-...-6dbb570 Latest Latest
Warning

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

Go to latest
Published: Dec 9, 2022 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateData

func CreateData(values form.Values, fields ...string) (dialect.H, error)

创建 insert 或者 update 需要的 data

func GeneratePaths

func GeneratePaths(fpp *FilePathParam, fileName, levelsStr, idStr string) (string, string, error)

生成文件地址和对应的 url

func MoveUploadFile

func MoveUploadFile(mfp *MoveFuncParam, values form.Values, levelsStr, idStr string) (string, error)

move upload file

func ParamsValidator

func ParamsValidator(values form.Values, pvr []ParamsValidateRule) error

参数验证,不满足规则要求时,就跳过

Types

type FilePathParam

type FilePathParam struct {
	Exts         []string // 允许上传的扩展名集合
	LevelsDirSet []int    // 通过hash字符串生成多级目录的设置
	UrlPrefix    string   // url 前缀
	PublishPath  string   // 发布目录绝对路径
}

type MoveFuncParam

type MoveFuncParam struct {
	FieldName   string // 表单中上传文件字段名称
	UploadsPath string // goadmin默认上传目录
	FPP         *FilePathParam
}

type ParamsValidateRule

type ParamsValidateRule struct {
	Field string // 要检查的字段名称
	Type  string //要检查的字段类型,number 和 text
	Start int    // 开始位置
	End   int    // 结束位置
}

Jump to

Keyboard shortcuts

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