Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Destination ¶
type Destination interface { PartWriter io.Closer // 切片 Split(totalSize, partSize uint64, options *SplitOptions) ([]Part, error) // 数据目标 ID DestinationID() (string, error) // 获取文件,如果数据源不是文件,则返回 nil GetFile() *os.File }
数据目标
func NewWriteAtCloserDestination ¶
func NewWriteAtCloserDestination(wr WriteAtCloser, destinationID string) Destination
将 io.WriterAt + io.WriteSeeker + io.Closer 封装为数据目标
func NewWriteCloserDestination ¶
func NewWriteCloserDestination(wr io.WriteCloser, destinationID string) Destination
将 io.WriteCloser 封装为数据目标
type Part ¶
type Part interface { PartWriter // 分片大小 Size() uint64 // 分片偏移量 Offset() uint64 // 分片偏移量 HaveDownloaded() uint64 }
分片
type PartWriter ¶
type PartWriter interface { // 从 `io.Reader` 复制数据写入 CopyFrom(io.Reader, func(uint64)) (uint64, error) }
分片写入接口
type SplitOptions ¶
type SplitOptions struct { // 只读可恢复记录仪介质 Medium resumablerecorder.ReadableResumableRecorderMedium }
切片选项
type WriteAtCloser ¶
Click to show internal directories.
Click to hide internal directories.