upload

package
v1.3.17 Latest Latest
Warning

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

Go to latest
Published: Apr 14, 2026 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
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

func NormalizeFileName(filePath string, artifactID, version string) string

NormalizeFileName handles special cases like pom.xml

func NormalizePomFilename

func NormalizePomFilename(artifactID, version string) string

NormalizePomFilename converts pom.xml to Maven build .pom structure

Types

type BaseFileUploadJob

type BaseFileUploadJob struct {
	ID       string
	FilePath string
	FileSize int64
}

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

type FileContent struct {
	Reader     io.Reader
	Size       int64
	IsInMemory bool
	Data       []byte
}

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

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

func (*MavenUploadJob) Upload

func (j *MavenUploadJob) Upload(ctx context.Context) error

performs the Maven artifact upload

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

func (*PythonUploadJob) Upload

func (j *PythonUploadJob) Upload(ctx context.Context) error

Python package upload

Jump to

Keyboard shortcuts

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