Documentation ¶
Index ¶
- Constants
- Variables
- func MergeChunkToOneFile(fileDirectory string, fileName string, fileSize int64, chunkTotalNumber int, ...)
- type Controller
- func (c *Controller) AjaxList(msgno int, msg interface{}, count int, data interface{}, arg ...interface{})
- func (c *Controller) AjaxMap(msgno int, msg interface{}, m map[string]interface{}, arg ...interface{})
- func (c *Controller) AjaxMsg(msgno int, msg interface{}, arg ...interface{})
- func (c *Controller) GetParameterInt(key string) int
- func (c *Controller) GetParameterInt64(key string) int64
- func (c *Controller) GetParameterInts(key string) []int
- func (c *Controller) GetParameterString(key string) string
- func (c *Controller) GetParameterStrings(key string) []string
- func (c *Controller) Prepare()
- func (c *Controller) ServeDownloadFile(fileName, filePathName string)
- type NestPreparer
- type TBigFileContext
- type TUploadBigFileController
Constants ¶
const ( MSGOK = 0 MSGERR = -1 )
Variables ¶
var GUploadFileMap sync.Map
GUploadFileMap 保存每一个大文件上传过程中需要的数据
Functions ¶
func MergeChunkToOneFile ¶
func MergeChunkToOneFile( fileDirectory string, fileName string, fileSize int64, chunkTotalNumber int, fileNameFormatStr string, )
MergeChunkToOneFile 把多个 chunk 合并为一个文件 @param fileDirectory: chunk 所在的目录 @param fileName: 文件名 @param fileSize: 文件大小,单位:字节 @param chunkTotalNumber: 一共有多少个 chunk @param fileNameFormatStr: chunk 文件名格式
Types ¶
type Controller ¶
Controller base controller
func (*Controller) AjaxList ¶
func (c *Controller) AjaxList(msgno int, msg interface{}, count int, data interface{}, arg ...interface{})
AjaxList 返回 列表
func (*Controller) AjaxMap ¶
func (c *Controller) AjaxMap(msgno int, msg interface{}, m map[string]interface{}, arg ...interface{})
AjaxMap 返回
func (*Controller) AjaxMsg ¶
func (c *Controller) AjaxMsg(msgno int, msg interface{}, arg ...interface{})
AjaxMsg 返回
func (*Controller) GetParameterInt ¶
func (c *Controller) GetParameterInt(key string) int
GetParameterInt 获取客户端 int 参数
func (*Controller) GetParameterInt64 ¶
func (c *Controller) GetParameterInt64(key string) int64
GetParameterInt64 获取客户端 int64 参数
func (*Controller) GetParameterInts ¶
func (c *Controller) GetParameterInts(key string) []int
GetParameterInts 获取客户端 int 参数
func (*Controller) GetParameterString ¶
func (c *Controller) GetParameterString(key string) string
GetParameterString 获取客户端 string 参数
func (*Controller) GetParameterStrings ¶
func (c *Controller) GetParameterStrings(key string) []string
GetParameterStrings 获取客户端 string 参数
func (*Controller) ServeDownloadFile ¶
func (c *Controller) ServeDownloadFile(fileName, filePathName string)
ServeDownloadFile 处理下载请求
type NestPreparer ¶
type NestPreparer interface {
NestPrepare()
}
NestPreparer exec NestPrepare after base controller Prepare
type TBigFileContext ¶
type TBigFileContext struct { // FileName 文件名 FileName string // FileSize 文件大小,单位:字节 FileSize int64 // FileDirectory 保存 chunk 的目录 FileDirectory string // SuccessReceivedChunkNum 成功收到的 chunk 数量 SuccessReceivedChunkNum int }
TBigFileContext 大文件上下文
func NewBigFileContext ¶
func NewBigFileContext( fileName string, fileSize int64, fileDirectory string, ) *TBigFileContext
NewBigFileContext 新建一个大文件上下文
type TUploadBigFileController ¶
type TUploadBigFileController struct {
Controller
}
TUploadBigFileController 大文件上传控制器
func (*TUploadBigFileController) GetUploadPage ¶
func (c *TUploadBigFileController) GetUploadPage()
GetUploadPage 获取上传页面
func (*TUploadBigFileController) UploadBigFileInit ¶
func (c *TUploadBigFileController) UploadBigFileInit()
UploadBigFileInit 上传大文件初始化
func (*TUploadBigFileController) UploadOneChunk ¶
func (c *TUploadBigFileController) UploadOneChunk()
UploadOneChunk 接收 chunk