Documentation ¶
Index ¶
- type ChunkGroup
- func (c *ChunkGroup) Index() int
- func (c *ChunkGroup) IsLast() bool
- func (c *ChunkGroup) Length() int64
- func (c *ChunkGroup) Next() bool
- func (c *ChunkGroup) Num() int
- func (c *ChunkGroup) Process(processor ChunkProcessFunc) error
- func (c *ChunkGroup) RangeHeader() string
- func (c *ChunkGroup) Start() int64
- func (c *ChunkGroup) TempAvailable() bool
- func (c *ChunkGroup) Total() int64
- type ChunkProcessFunc
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ChunkGroup ¶
type ChunkGroup struct {
// contains filtered or unexported fields
}
ChunkGroup manage groups of chunks
func NewChunkGroup ¶
func NewChunkGroup(file fsctx.FileHeader, chunkSize uint64, backoff backoff.Backoff, useBuffer bool) *ChunkGroup
func (*ChunkGroup) Index ¶
func (c *ChunkGroup) Index() int
Index returns current chunk index, starts from 0
func (*ChunkGroup) IsLast ¶
func (c *ChunkGroup) IsLast() bool
IsLast returns if current chunk is the last one
func (*ChunkGroup) Length ¶
func (c *ChunkGroup) Length() int64
Length returns the length of current chunk
func (*ChunkGroup) Next ¶
func (c *ChunkGroup) Next() bool
Next switch to next chunk, returns whether all chunks are processed
func (*ChunkGroup) Process ¶
func (c *ChunkGroup) Process(processor ChunkProcessFunc) error
Process a chunk with retry logic
func (*ChunkGroup) RangeHeader ¶
func (c *ChunkGroup) RangeHeader() string
RangeHeader returns header value of Content-Range
func (*ChunkGroup) Start ¶
func (c *ChunkGroup) Start() int64
Start returns the byte index of current chunk
func (*ChunkGroup) TempAvailable ¶
func (c *ChunkGroup) TempAvailable() bool
TempAvailable returns if current chunk temp file is available to be read
type ChunkProcessFunc ¶
type ChunkProcessFunc func(c *ChunkGroup, chunk io.Reader) error
ChunkProcessFunc callback function for processing a chunk
Click to show internal directories.
Click to hide internal directories.