Versions in this module Expand all Collapse all v4 v4.2.5 Aug 7, 2026 Changes in this version + var DefaultManager = &Manager + var ErrChunkInFlight = errors.New("chunk is being uploaded by another request") + var ErrClosed = errors.New("multipart upload window closed") + var ErrNotOwner = errors.New("multipart upload session belongs to another user") + var ErrOutOfWindow = errors.New("chunk is out of the receiving window") + var ErrSessionNotFound = errors.New("multipart upload session not found") + var WindowSlots = 8 + var WindowWaitTimeout = 10 * time.Second + type InitReq struct + ChunkSize int64 + Hashes map[*utils.HashType]string + Mimetype string + Modified time.Time + Path string + Size int64 + User *model.User + type Manager struct + func (m *Manager) Abort(user *model.User, id string) error + func (m *Manager) Chunk(user *model.User, id string, idx int, body io.Reader) (SessionSnapshot, error) + func (m *Manager) Complete(ctx context.Context, user *model.User, id string) (SessionSnapshot, error) + func (m *Manager) Find(user *model.User, path string, size int64) (SessionSnapshot, error) + func (m *Manager) Init(req InitReq) (SessionSnapshot, bool, error) + func (m *Manager) StartGC() + func (m *Manager) Status(user *model.User, id string) (SessionSnapshot, error) + type Session struct + ChunkSize int64 + Creator *model.User + DstDir string + Hashes map[*utils.HashType]string + ID string + Mimetype string + Modified time.Time + Name string + Path string + Size int64 + Total int + func (s *Session) Snapshot() SessionSnapshot + type SessionSnapshot struct + Attempt int + ChunkSize int64 + Error string + Frontier int + ID string + Path string + Received [][2]int + ReceivedBytes int64 + Size int64 + State State + StorageProgress float64 + TotalChunks int + type Snapshot struct + Frontier int + ReadPos int64 + Received [][2]int + ReceivedBytes int64 + type State string + const StateAborted + const StateCompleted + const StateFailedPermanent + const StateFailedRetriable + const StateReceiving + type Window struct + func NewWindow(dir, id string, chunkSize, totalSize int64, slots int) (*Window, error) + func (w *Window) CRCs() ([]uint32, []bool) + func (w *Window) ChunkLen(idx int) int64 + func (w *Window) Close() error + func (w *Window) CloseWithError(sticky error) error + func (w *Window) Read(p []byte) (int, error) + func (w *Window) Snapshot() Snapshot + func (w *Window) TotalChunks() int + func (w *Window) WriteChunk(idx int, r io.Reader) (uint32, error)