chunk

package
v1.10.6 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 22, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Service

type Service struct {
	// contains filtered or unexported fields
}

Service 分块服务

func NewService

func NewService(repositoryManager *repository.RepositoryManager, manager *config.ConfigManager, storageService *storage.ConcreteStorageService) *Service

NewService 创建分块服务

func (*Service) CancelUpload

func (s *Service) CancelUpload(uploadID string) error

CancelUpload 取消分片上传

func (*Service) CheckUploadProgress

func (s *Service) CheckUploadProgress(uploadID string) (float64, error)

CheckUploadProgress 检查上传进度

func (*Service) CleanupExpiredUploads

func (s *Service) CleanupExpiredUploads() (int, error)

CleanupExpiredUploads 清理过期的上传

func (*Service) CompleteUpload

func (s *Service) CompleteUpload(uploadID string) error

CompleteUpload 完成分片上传

func (*Service) GetUploadInfo

func (s *Service) GetUploadInfo(uploadID string) (*models.UploadChunk, error)

GetUploadInfo 获取上传信息

func (*Service) GetUploadStatus

func (s *Service) GetUploadStatus(uploadID string) (*models.ChunkUploadStatusData, error)

GetUploadStatus 获取上传状态 (兼容性方法)

func (*Service) InitChunkUpload

func (s *Service) InitChunkUpload(uploadID, fileName string, totalChunks int, fileSize int64) (*models.UploadChunk, error)

InitChunkUpload 初始化分片上传 (兼容性方法)

func (*Service) InitiateUpload

func (s *Service) InitiateUpload(uploadID, fileName string, totalChunks int, fileSize int64) (*models.UploadChunk, error)

InitiateUpload 初始化分片上传

func (*Service) IsUploadComplete

func (s *Service) IsUploadComplete(uploadID string) (bool, error)

IsUploadComplete 检查上传是否完成

func (*Service) ListChunks

func (s *Service) ListChunks(uploadID string) ([]*models.UploadChunk, error)

ListChunks 列出分片

func (*Service) UploadChunk

func (s *Service) UploadChunk(uploadID string, chunkIndex int, chunkHash string, chunkSize int) (*models.UploadChunk, error)

UploadChunk 上传单个分片

func (*Service) VerifyChunk

func (s *Service) VerifyChunk(uploadID string, chunkIndex int, expectedHash string) (bool, error)

VerifyChunk 验证分片 (占位符实现)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL