mirror of
https://github.com/kovidgoyal/kitty
synced 2026-07-28 19:21:38 +02:00
Start work on porting receive code to Go
This commit is contained in:
@@ -12,6 +12,7 @@ import (
|
||||
|
||||
"kitty/tools/crypto"
|
||||
"kitty/tools/utils"
|
||||
"kitty/tools/utils/humanize"
|
||||
)
|
||||
|
||||
var _ = fmt.Print
|
||||
@@ -104,3 +105,10 @@ func should_be_compressed(path, strategy string) bool {
|
||||
}
|
||||
return true
|
||||
}
|
||||
|
||||
func print_rsync_stats(total_bytes, delta_bytes, signature_bytes int64) {
|
||||
fmt.Println("Rsync stats:")
|
||||
fmt.Printf(" Delta size: %s Signature size: %s\n", humanize.Size(delta_bytes), humanize.Size(signature_bytes))
|
||||
frac := float64(delta_bytes+signature_bytes) / float64(utils.Max(1, total_bytes))
|
||||
fmt.Printf(" Transmitted: %s of a total of %s (%.1f%%)\n", humanize.Size(delta_bytes+signature_bytes), humanize.Size(total_bytes), frac*100)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user