Documentation ¶
Overview ¶
Package multipartreader helps you encode large files in MIME multipart format without reading the entire content into memory.
Index ¶
- type MultipartReader
- func (mr *MultipartReader) AddFormFeild(fieldname string, readerlen ReaderLen)
- func (mr *MultipartReader) AddFormFile(fieldname, filename string, readerlen64 ReaderLen64)
- func (mr *MultipartReader) ContentType() string
- func (mr *MultipartReader) Len() int64
- func (mr *MultipartReader) Read(p []byte) (n int, err error)
- func (mr *MultipartReader) Readed() int64
- func (mr *MultipartReader) SetupHTTPRequest(req *http.Request)
- type ReadedLen64
- type ReaderLen
- type ReaderLen64
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type MultipartReader ¶
type MultipartReader struct {
// contains filtered or unexported fields
}
MultipartReader MIME multipart format
func NewMultipartReader ¶
func NewMultipartReader() (mr *MultipartReader)
NewMultipartReader 返回初始化的 *MultipartReader
func (*MultipartReader) AddFormFeild ¶
func (mr *MultipartReader) AddFormFeild(fieldname string, readerlen ReaderLen)
AddFormFeild 增加 form 表单
func (*MultipartReader) AddFormFile ¶
func (mr *MultipartReader) AddFormFile(fieldname, filename string, readerlen64 ReaderLen64)
AddFormFile 增加 form 文件表单
func (*MultipartReader) ContentType ¶
func (mr *MultipartReader) ContentType() string
ContentType 返回 Content-Type
func (*MultipartReader) Readed ¶
func (mr *MultipartReader) Readed() int64
Readed 返回 form 表单已读取的数据量, 用于计算上传速度等
func (*MultipartReader) SetupHTTPRequest ¶
func (mr *MultipartReader) SetupHTTPRequest(req *http.Request)
SetupHTTPRequest 为 *http.Request 配置
type ReadedLen64 ¶
type ReadedLen64 interface { ReaderLen64 Readed() int64 }
ReadedLen64 实现io.Reader, 64-bit长度接口和已读取数据量接口
func NewFileReadedLen64 ¶
func NewFileReadedLen64(f *os.File) ReadedLen64
NewFileReadedLen64 *os.File 实现 ReadedLen64 接口
type ReaderLen64 ¶
ReaderLen64 实现io.Reader和64-bit长度接口
Click to show internal directories.
Click to hide internal directories.