transferfiles

package
v2.21.0 Latest Latest
Warning

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

Go to latest
Published: Sep 18, 2022 License: Apache-2.0 Imports: 43 Imported by: 0

Documentation

Index

Constants

View Source
const (
	FullTransferPhase int = 0
	FilesDiffPhase    int = 1
	ErrorsPhase       int = 2
)
View Source
const (
	DefaultAqlPaginationLimit = 10000
)

Variables

View Source
var AqlPaginationLimit = DefaultAqlPaginationLimit

Functions

func GetThreads added in v2.19.0

func GetThreads() int

func NewSrcUserPluginService

func NewSrcUserPluginService(artDetails auth.ServiceDetails, client *jfroghttpclient.JfrogHttpClient) *srcUserPluginService

func ShouldStop added in v2.19.0

func ShouldStop(phase *phaseBase, delayHelper *delayUploadHelper, errorsChannelMng *ErrorsChannelMng) bool

ShouldStop Stop transferring if one of the following happened: * Error occurred while handling errors (for example - not enough space in file system) * Error occurred during delayed artifacts handling * User interrupted the process (ctrl+c)

Types

type ChunkFileStatusType

type ChunkFileStatusType string
const (
	Success             ChunkFileStatusType = "SUCCESS"
	Fail                ChunkFileStatusType = "FAIL"
	SkippedLargeProps   ChunkFileStatusType = "SKIPPED_LARGE_PROPS"
	SkippedMetadataFile ChunkFileStatusType = "SKIPPED_METADATA_FILE"
)

type ChunkStatus

type ChunkStatus struct {
	UuidTokenResponse
	Status         ProcessStatusType          `json:"status,omitempty"`
	Files          []FileUploadStatusResponse `json:"files,omitempty"`
	DurationMillis int64                      `json:"duration_millis,omitempty"`
}

type DelayedArtifactsChannelMng added in v2.18.2

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

DelayedArtifactsChannelMng is used when writing 'delayed artifacts' to a common channel. If an error occurs while handling the files - this message is used to stop adding elements to the channel.

type DelayedArtifactsFile

type DelayedArtifactsFile struct {
	DelayedArtifacts []FileRepresentation `json:"delayed_artifacts,omitempty"`
}

type DiffDetails added in v2.19.1

type DiffDetails struct {
	FilesDiffRunTime      PhaseDetails `json:"files_diff,omitempty"`
	PropertiesDiffRunTime PhaseDetails `json:"properties_diff,omitempty"`
	HandledRange          PhaseDetails `json:"handled_range,omitempty"`
	Completed             bool         `json:"completed,omitempty"`
}

type ErrorsChannelMng added in v2.18.2

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

ErrorsChannelMng handles the uploading errors and adds them to a common channel. Stops adding elements to the channel if an error occurs while handling the files.

type ExtendedFileUploadStatusResponse added in v2.18.7

type ExtendedFileUploadStatusResponse struct {
	FileUploadStatusResponse
	Time string `json:"time,omitempty"`
}

type FileRepresentation

type FileRepresentation struct {
	Repo string `json:"repo,omitempty"`
	Path string `json:"path,omitempty"`
	Name string `json:"name,omitempty"`
}

type FileUploadStatusResponse

type FileUploadStatusResponse struct {
	FileRepresentation
	SizeBytes        int64               `json:"size_bytes,omitempty"`
	ChecksumDeployed bool                `json:"checksum_deployed,omitempty"`
	Status           ChunkFileStatusType `json:"status,omitempty"`
	StatusCode       int                 `json:"status_code,omitempty"`
	Reason           string              `json:"reason,omitempty"`
}

type FilesErrors

type FilesErrors struct {
	Errors []ExtendedFileUploadStatusResponse `json:"errors,omitempty"`
}

type HandlePropertiesDiff

type HandlePropertiesDiff struct {
	TargetAuth
	RepoKey           string `json:"repo_key,omitempty"`
	StartMilliseconds string `json:"start_milliseconds,omitempty"`
	EndMilliseconds   string `json:"end_milliseconds,omitempty"`
}

type HandlePropertiesDiffResponse

type HandlePropertiesDiffResponse struct {
	NodeIdResponse
	PropertiesDelivered json.Number               `json:"properties_delivered,omitempty"`
	PropertiesTotal     json.Number               `json:"properties_total,omitempty"`
	Status              ProcessStatusType         `json:"status,omitempty"`
	Errors              []PropertiesHandlingError `json:"errors,omitempty"`
}

type InterruptionErr added in v2.19.0

type InterruptionErr struct{}

func (*InterruptionErr) Error added in v2.19.0

func (m *InterruptionErr) Error() string

type NodeIdResponse

type NodeIdResponse struct {
	NodeId string `json:"node_id,omitempty"`
}

type PhaseDetails

type PhaseDetails struct {
	Started string `json:"started,omitempty"`
	Ended   string `json:"ended,omitempty"`
}

type PollingTasksManager added in v2.18.2

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

type ProcessStatusType

type ProcessStatusType string
const (
	Done       ProcessStatusType = "DONE"
	InProgress ProcessStatusType = "IN_PROGRESS"
)

type PropertiesHandlingError

type PropertiesHandlingError struct {
	FileRepresentation
	StatusCode string `json:"status_code,omitempty"`
	Reason     string `json:"reason,omitempty"`
}

type Repository

type Repository struct {
	Name                 string        `json:"name,omitempty"`
	FullTransfer         PhaseDetails  `json:"full_transfer,omitempty"`
	Diffs                []DiffDetails `json:"diffs,omitempty"`
	TransferredSizeBytes int64         `json:"transferred_size_bytes,omitempty"`
}

type TargetAuth

type TargetAuth struct {
	TargetArtifactoryUrl string `json:"target_artifactory_url,omitempty"`
	TargetUsername       string `json:"target_username,omitempty"`
	TargetPassword       string `json:"target_password,omitempty"`
	TargetToken          string `json:"target_token,omitempty"`
	TargetProxyKey       string `json:"target_proxy_key,omitempty"`
}

type TransferDelayedArtifactsMng

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

TransferDelayedArtifactsMng takes care of the multi-threaded-writing of artifacts to be transferred, while maintaining the correct order of the deployment. This is needed because, for example, for maven repositories, pom file should be deployed last.

type TransferErrorsMng

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

TransferErrorsMng manages multi threads writing errors. We want to create a file which contains all upload error statuses for each repository and phase. Those files will serve us in 2 cases: 1. Whenever we re-run 'transfer-files' command, we want to attempt to upload failed files again. 2. As part of the transfer process, we generate a csv file that contains all upload errors. In case an error occurs when creating those upload errors files, we would like to stop the transfer right away.

type TransferFilesCommand

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

func NewTransferFilesCommand

func NewTransferFilesCommand(sourceServer, targetServer *config.ServerDetails) *TransferFilesCommand

func (*TransferFilesCommand) CommandName

func (tdc *TransferFilesCommand) CommandName() string

func (*TransferFilesCommand) Run

func (tdc *TransferFilesCommand) Run() (err error)

func (*TransferFilesCommand) SetExcludeReposPatterns

func (tdc *TransferFilesCommand) SetExcludeReposPatterns(excludeReposPatterns []string)

func (*TransferFilesCommand) SetFilestore

func (tdc *TransferFilesCommand) SetFilestore(filestore bool)

func (*TransferFilesCommand) SetIgnoreState added in v2.20.3

func (tdc *TransferFilesCommand) SetIgnoreState(ignoreState bool)

func (*TransferFilesCommand) SetIncludeReposPatterns

func (tdc *TransferFilesCommand) SetIncludeReposPatterns(includeReposPatterns []string)

func (*TransferFilesCommand) SetProxyKey added in v2.21.0

func (tdc *TransferFilesCommand) SetProxyKey(proxyKey string)

type TransferJobType added in v2.20.0

type TransferJobType string
const (
	Repositories TransferJobType = "Repositories"
	Files        TransferJobType = "Files"
	TimeSlots    TransferJobType = "Time Slots"
)

func (TransferJobType) String added in v2.20.0

func (tt TransferJobType) String() string

type TransferProgressMng added in v2.20.0

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

TransferProgressMng provides progress indication for the jf rt transfer-files command. Transferring one repository's data at a time.

func NewTransferProgressMng added in v2.20.0

func NewTransferProgressMng(totalRepositories int64, timeEstMng *timeEstimationManager) (*TransferProgressMng, error)

NewTransferProgressMng creates TransferProgressMng object. If the progress bar shouldn't be displayed returns nil.

func (*TransferProgressMng) AddPhase1 added in v2.20.0

func (t *TransferProgressMng) AddPhase1(tasksPhase1 int64)

func (*TransferProgressMng) AddPhase2 added in v2.20.0

func (t *TransferProgressMng) AddPhase2(tasksPhase2 int64)

func (*TransferProgressMng) AddPhase3 added in v2.21.0

func (t *TransferProgressMng) AddPhase3(tasksPhase3 int64)

func (*TransferProgressMng) DonePhase added in v2.20.0

func (t *TransferProgressMng) DonePhase(id int) error

func (*TransferProgressMng) IncrementPhase added in v2.20.0

func (t *TransferProgressMng) IncrementPhase(id int) error

IncrementPhase increments completed tasks count for a specific phase by 1.

func (*TransferProgressMng) IncrementPhaseBy added in v2.20.0

func (t *TransferProgressMng) IncrementPhaseBy(id, n int) error

IncrementPhaseBy increments completed tasks count for a specific phase by n.

func (*TransferProgressMng) NewRepository added in v2.20.0

func (t *TransferProgressMng) NewRepository(name string)

NewRepository adds new repository's progress details. Aborting previous repository if exists.

func (*TransferProgressMng) Quit added in v2.20.0

func (t *TransferProgressMng) Quit() error

Quit terminate the TransferProgressMng process.

func (*TransferProgressMng) RemoveRepository added in v2.20.0

func (t *TransferProgressMng) RemoveRepository()

func (*TransferProgressMng) SetRunningThreads added in v2.20.0

func (t *TransferProgressMng) SetRunningThreads(n int)

func (*TransferProgressMng) ShouldDisplay added in v2.20.0

func (t *TransferProgressMng) ShouldDisplay() bool

func (*TransferProgressMng) StopGracefully added in v2.20.0

func (t *TransferProgressMng) StopGracefully()

type TransferState

type TransferState struct {
	Repositories []Repository `json:"repositories,omitempty"`
}

This struct holds the current state of the whole transfer of the source Artifactory instance. It is saved to a file in JFrog CLI's home. The command determines actions based on the state, such as if full transfer need or was completed before, on what time range files diffs should be fixed, etc.

type UploadChunk

type UploadChunk struct {
	TargetAuth
	CheckExistenceInFilestore bool                 `json:"check_existence_in_filestore,omitempty"`
	UploadCandidates          []FileRepresentation `json:"upload_candidates,omitempty"`
}

type UploadChunkResponse

type UploadChunkResponse struct {
	NodeIdResponse
	UuidTokenResponse
}

type UploadChunksStatusBody

type UploadChunksStatusBody struct {
	AwaitingStatusChunks []string `json:"awaiting_status_chunks,omitempty"`
	ChunksToDelete       []string `json:"chunks_to_delete,omitempty"`
}

type UploadChunksStatusResponse

type UploadChunksStatusResponse struct {
	NodeIdResponse
	ChunksStatus  []ChunkStatus `json:"chunks_status,omitempty"`
	DeletedChunks []string      `json:"deleted_chunks,omitempty"`
}

type UuidTokenResponse

type UuidTokenResponse struct {
	UuidToken string `json:"uuid_token,omitempty"`
}

type VerifyCompatibilityResponse added in v2.20.5

type VerifyCompatibilityResponse struct {
	Version string `json:"version,omitempty"`
	Message string `json:"message,omitempty"`
}

Jump to

Keyboard shortcuts

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