Documentation
¶
Index ¶
- Constants
- func GetSuccessfulUploads(results []FileUploadResult) int
- func GetUploadErrors(results []FileUploadResult) map[string]error
- func HasUploadErrors(results []FileUploadResult) bool
- func NormalizeFileName(filePath string, artifactID, version string) string
- func NormalizePomFilename(artifactID, version string) string
- type BaseFileUploadJob
- type FileContent
- type FileUploadEngine
- type FileUploadJob
- type FileUploadResult
- type MavenUploadJob
- type PythonUploadJob
Constants ¶
const (
DefaultUploadWorker = 5
)
Variables ¶
This section is empty.
Functions ¶
func GetSuccessfulUploads ¶
func GetSuccessfulUploads(results []FileUploadResult) int
returns count of successful uploads
func GetUploadErrors ¶
func GetUploadErrors(results []FileUploadResult) map[string]error
this will returns a map of failed uploads
func HasUploadErrors ¶
func HasUploadErrors(results []FileUploadResult) bool
checks if any results contain errors
func NormalizeFileName ¶
NormalizeFileName handles special cases like pom.xml
func NormalizePomFilename ¶
NormalizePomFilename converts pom.xml to Maven build .pom structure
Types ¶
type BaseFileUploadJob ¶
BaseFileUploadJob provides common functionality for file upload jobs
func (*BaseFileUploadJob) GetFilePath ¶
func (b *BaseFileUploadJob) GetFilePath() string
func (*BaseFileUploadJob) GetFileSize ¶
func (b *BaseFileUploadJob) GetFileSize() int64
func (*BaseFileUploadJob) GetID ¶
func (b *BaseFileUploadJob) GetID() string
type FileContent ¶
FileContent represents file content that can be either from disk or in-memory
func NewFileContentFromDisk ¶
func NewFileContentFromDisk(reader io.Reader, size int64) *FileContent
creates FileContent from a file path
func NewFileContentFromMemory ¶
func NewFileContentFromMemory(data []byte) *FileContent
creates FileContent from in-memory data
type FileUploadEngine ¶
type FileUploadEngine struct {
// contains filtered or unexported fields
}
manages concurrent file uploads
func NewFileUploadEngine ¶
func NewFileUploadEngine(maxWorkers int, progress p.Reporter) *FileUploadEngine
createing a new upload engine , to perform upload concurrently
func (*FileUploadEngine) Execute ¶
func (e *FileUploadEngine) Execute(ctx context.Context, jobs []FileUploadJob) []FileUploadResult
Execute runs all upload jobs concurrently
type FileUploadJob ¶
type FileUploadJob interface {
// GetID returns a unique identifier for this upload job
GetID() string
// GetFilePath returns the file path (for display purposes)
GetFilePath() string
// GetFileSize returns the file size in bytes
GetFileSize() int64
// Upload performs the actual upload operation
Upload(ctx context.Context) error
}
FileUploadJob represents a single file upload operation
type FileUploadResult ¶
type FileUploadResult struct {
JobID string
FilePath string
FileSize int64
Error error
Success bool
}
FileUploadResult represents the result of a file upload
type MavenUploadJob ¶
type MavenUploadJob struct {
BaseFileUploadJob
RegistryName string
GroupID string
ArtifactID string
Version string
FileName string
FileContent *FileContent
}
func NewMavenUploadJobFromDisk ¶
func NewMavenUploadJobFromDisk(filePath, fileName, registryName, groupID, artifactID, version string, fileSize int64) *MavenUploadJob
creates a Maven upload job from a file on disk
func NewMavenUploadJobFromMemory ¶
func NewMavenUploadJobFromMemory(fileName, registryName, groupID, artifactID, version string, data []byte) *MavenUploadJob
using for checkusm , as that is inMemory
type PythonUploadJob ¶
type PythonUploadJob struct {
BaseFileUploadJob
FilePath string
RegistryName string
PackageName string
Version string
}
Python package upload job
func NewPythonUploadJob ¶
func NewPythonUploadJob(filePath, registryName, packageName, version string, fileSize int64) *PythonUploadJob
NewPythonUploadJob creates a new Python upload job