github.com/jfrog/jfrog-cli-core/v2@v2.52.0/artifactory/utils/upload.go (about)

     1  package utils
     2  
     3  import (
     4  	"os"
     5  	"strconv"
     6  
     7  	"github.com/jfrog/jfrog-cli-core/v2/utils/config"
     8  	"github.com/jfrog/jfrog-client-go/artifactory"
     9  	"github.com/jfrog/jfrog-client-go/artifactory/services"
    10  	"github.com/jfrog/jfrog-client-go/utils/errorutils"
    11  	"github.com/jfrog/jfrog-client-go/utils/io"
    12  )
    13  
    14  func CreateUploadServiceManager(serverDetails *config.ServerDetails, threads, httpRetries, httpRetryWaitMilliSecs int, dryRun bool, progressBar io.ProgressMgr) (artifactory.ArtifactoryServicesManager, error) {
    15  	return CreateServiceManagerWithProgressBar(serverDetails, threads, httpRetries, httpRetryWaitMilliSecs, dryRun, progressBar)
    16  }
    17  
    18  type UploadConfiguration struct {
    19  	Deb                   string
    20  	Threads               int
    21  	MinChecksumDeploySize int64
    22  	ExplodeArchive        bool
    23  	SplitCount            int
    24  	MinSplitSizeMB        int64
    25  	ChunkSizeMB           int64
    26  }
    27  
    28  func GetMinChecksumDeploySize() (int64, error) {
    29  	minChecksumDeploySize := os.Getenv("JFROG_CLI_MIN_CHECKSUM_DEPLOY_SIZE_KB")
    30  	if minChecksumDeploySize == "" {
    31  		return services.DefaultMinChecksumDeploy, nil
    32  	}
    33  	minSize, err := strconv.ParseInt(minChecksumDeploySize, 10, 64)
    34  	err = errorutils.CheckError(err)
    35  	if err != nil {
    36  		return 0, err
    37  	}
    38  	return minSize * 1000, nil
    39  }