MCPcopy Index your code
hub / github.com/peak/s5cmd / generateDestinationURL

Function generateDestinationURL

command/sync.go:535–550  ·  view source on GitHub ↗

generateDestinationURL generates destination url for given source url if it would have been in destination.

(srcurl, dsturl *url.URL, isBatch bool)

Source from the content-addressed store, hash-verified

533// generateDestinationURL generates destination url for given
534// source url if it would have been in destination.
535func generateDestinationURL(srcurl, dsturl *url.URL, isBatch bool) *url.URL {
536 objname := srcurl.Base()
537 if isBatch {
538 objname = srcurl.Relative()
539 }
540
541 if dsturl.IsRemote() {
542 if dsturl.IsPrefix() || dsturl.IsBucket() {
543 return dsturl.Join(objname)
544 }
545 return dsturl.Clone()
546
547 }
548
549 return dsturl.Join(objname)
550}
551
552// shouldSkipObject checks is object should be skipped.
553func (s Sync) shouldSkipSrcObject(object *storage.Object, verbose bool) bool {

Callers 1

planRunMethod · 0.85

Calls 7

BaseMethod · 0.80
RelativeMethod · 0.80
IsRemoteMethod · 0.80
IsPrefixMethod · 0.80
IsBucketMethod · 0.80
JoinMethod · 0.80
CloneMethod · 0.80

Tested by

no test coverage detected