controller

package
v0.0.0-...-34c3de1 Latest Latest
Warning

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

Go to latest
Published: Mar 3, 2021 License: MIT Imports: 24 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func APIPing

func APIPing(c *gin.Context)

APIPing ping测试接口

func CheckExist

func CheckExist(c *gin.Context)

CheckExist 检查资源是否存在.

func FileDownloadSimple

func FileDownloadSimple(url, referer, userAgent string) (body []byte, err error)

FileDownloadSimple 文件下载.

func InitUpload

func InitUpload(isTest bool)

func SaveFileToCloud

func SaveFileToCloud(appID, rid_, hash, filename, contentType string, bodyReader io.Reader, bodyLen int64,
	width, height, duration int, extInfo string) (url string, errmsg string)

func SaveFileToLocal

func SaveFileToLocal(filename string, body []byte) error

func UploadChunkInit

func UploadChunkInit(c *gin.Context)

UploadChunkInit 分成上传初始化

func UploadChunkUpload

func UploadChunkUpload(c *gin.Context)

UploadChunkUpload 分块上传.

func UploadSimple

func UploadSimple(c *gin.Context)

UploadSimple 直接通过http body上传文件.

func UploadURLSimple

func UploadURLSimple(c *gin.Context)

UploadURLSimple 通过URL上传图片

Types

type FileStatus

type FileStatus struct {
	xfile.BlockStatus
	URL string
	Rid string
	// Md5       string
	ChunkSize int
}

FileStatus 文件上传状态.

type StorageConfigEx

type StorageConfigEx struct {
	// contains filtered or unexported fields
}

type UContextPlus

type UContextPlus struct {
	*ginplus.ContextPlus
}

UContextPlus 扩展的上下文.

func NewUContextPlus

func NewUContextPlus(c *gin.Context) (context *UContextPlus)

NewUContextPlus 创建一个扩展上下文.

func (*UContextPlus) JSONFail

func (c *UContextPlus) JSONFail(status int, reason string)

JSONFail 返回出错信息

func (*UContextPlus) JSONOK

func (c *UContextPlus) JSONOK(data gin.H)

JSONOK 返回成功消息.

type UploadUrlSimpleReq

type UploadUrlSimpleReq struct {
	URL       string `json:"url" validate:"required"`
	Referer   string `json:"referer"`
	UserAgent string `json:"userAgent"`
}

UploadUrlSimpleReq 通过URL上传资源.

Jump to

Keyboard shortcuts

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