Documentation
¶
Index ¶
- type Service
- func (s *Service) CancelUpload(uploadID string) error
- func (s *Service) CheckUploadProgress(uploadID string) (float64, error)
- func (s *Service) CleanupExpiredUploads() (int, error)
- func (s *Service) CompleteUpload(uploadID string) error
- func (s *Service) GetUploadInfo(uploadID string) (*models.UploadChunk, error)
- func (s *Service) GetUploadStatus(uploadID string) (*models.ChunkUploadStatusData, error)
- func (s *Service) InitChunkUpload(uploadID, fileName string, totalChunks int, fileSize int64) (*models.UploadChunk, error)
- func (s *Service) InitiateUpload(uploadID, fileName string, totalChunks int, fileSize int64) (*models.UploadChunk, error)
- func (s *Service) IsUploadComplete(uploadID string) (bool, error)
- func (s *Service) ListChunks(uploadID string) ([]*models.UploadChunk, error)
- func (s *Service) UploadChunk(uploadID string, chunkIndex int, chunkHash string, chunkSize int) (*models.UploadChunk, error)
- func (s *Service) VerifyChunk(uploadID string, chunkIndex int, expectedHash string) (bool, error)
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 ¶
CancelUpload 取消分片上传
func (*Service) CheckUploadProgress ¶
CheckUploadProgress 检查上传进度
func (*Service) CleanupExpiredUploads ¶
CleanupExpiredUploads 清理过期的上传
func (*Service) CompleteUpload ¶
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 ¶
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 上传单个分片
Click to show internal directories.
Click to hide internal directories.