mirror of
https://github.com/openziti/zrok.git
synced 2025-08-18 03:39:58 +02:00
'zrok copy' now supports copy and oneway sync (#438)
This commit is contained in:
@@ -6,15 +6,18 @@ import (
|
||||
"os"
|
||||
)
|
||||
|
||||
func Synchronize(src, dst Target) error {
|
||||
func OneWay(src, dst Target, sync bool) error {
|
||||
srcTree, err := src.Inventory()
|
||||
if err != nil {
|
||||
return errors.Wrap(err, "error creating source inventory")
|
||||
}
|
||||
|
||||
dstTree, err := dst.Inventory()
|
||||
if err != nil {
|
||||
return errors.Wrap(err, "error creating destination inventory")
|
||||
var dstTree []*Object
|
||||
if sync {
|
||||
dstTree, err = dst.Inventory()
|
||||
if err != nil {
|
||||
return errors.Wrap(err, "error creating destination inventory")
|
||||
}
|
||||
}
|
||||
|
||||
dstIndex := make(map[string]*Object)
|
||||
|
Reference in New Issue
Block a user