starting on 'zrok copy from' (#438)

This commit is contained in:
Michael Quigley 2023-11-08 14:21:19 -05:00
parent 6e16a856a7
commit 3aea884f2d
No known key found for this signature in database
GPG Key ID: 9B60314A9DD20A62
4 changed files with 38 additions and 0 deletions

29
cmd/zrok/copyFrom.go Normal file
View File

@ -0,0 +1,29 @@
package main
import (
"github.com/io-developer/go-davsync/pkg/client/webdav"
"github.com/spf13/cobra"
)
func init() {
copyCmd.AddCommand(newCopyFromCommand().cmd)
}
type copyFromCommand struct {
cmd *cobra.Command
}
func newCopyFromCommand() *copyFromCommand {
cmd := &cobra.Command{
Use: "from <share> [<destination>]",
Short: "Copy files from zrok drive to destination",
Args: cobra.RangeArgs(1, 2),
}
command := &copyFromCommand{cmd: cmd}
cmd.Run = command.run
return command
}
func (cmd *copyFromCommand) run(_ *cobra.Command, args []string) {
_ = &webdav.Options{}
}

View File

@ -26,6 +26,7 @@ func init() {
testCmd.AddCommand(loopCmd)
rootCmd.AddCommand(adminCmd)
rootCmd.AddCommand(configCmd)
rootCmd.AddCommand(copyCmd)
rootCmd.AddCommand(shareCmd)
rootCmd.AddCommand(testCmd)
transport.AddAddressParser(tcp.AddressParser{})
@ -79,6 +80,11 @@ var configCmd = &cobra.Command{
Short: "Configure your zrok environment",
}
var copyCmd = &cobra.Command{
Use: "copy",
Short: "Copy files to/from zrok drives",
}
var loopCmd = &cobra.Command{
Use: "loopback",
Aliases: []string{"loop"},

1
go.mod
View File

@ -121,6 +121,7 @@ require (
github.com/imdario/mergo v0.3.12 // indirect
github.com/inconshreveable/mousetrap v1.1.0 // indirect
github.com/influxdata/line-protocol v0.0.0-20200327222509-2487e7298839 // indirect
github.com/io-developer/go-davsync v1.0.1 // indirect
github.com/jackc/chunkreader/v2 v2.0.1 // indirect
github.com/jackc/pgconn v1.14.0 // indirect
github.com/jackc/pgio v1.0.0 // indirect

2
go.sum
View File

@ -718,6 +718,8 @@ github.com/influxdata/influxdb-client-go/v2 v2.11.0/go.mod h1:YteV91FiQxRdccyJ2c
github.com/influxdata/influxdb1-client v0.0.0-20191209144304-8bf82d3c094d/go.mod h1:qj24IKcXYK6Iy9ceXlo3Tc+vtHo9lIhSX5JddghvEPo=
github.com/influxdata/line-protocol v0.0.0-20200327222509-2487e7298839 h1:W9WBk7wlPfJLvMCdtV4zPulc4uCPrlywQOmbFOhgQNU=
github.com/influxdata/line-protocol v0.0.0-20200327222509-2487e7298839/go.mod h1:xaLFMmpvUxqXtVkUJfg9QmT88cDaCJ3ZKgdZ78oO8Qo=
github.com/io-developer/go-davsync v1.0.1 h1:TDwpE+O3saK4WlFL1K66W6fFWEQMfccGnDjyq9R9MpU=
github.com/io-developer/go-davsync v1.0.1/go.mod h1:s+hh2DEKAHJQjSZiLqoW2ahLw+lcvzRThHPOr1vfOw4=
github.com/jackc/chunkreader v1.0.0/go.mod h1:RT6O25fNZIuasFJRyZ4R/Y2BbhasbmZXF9QQ7T3kePo=
github.com/jackc/chunkreader/v2 v2.0.0/go.mod h1:odVSm741yZoC3dpHEUXIqA9tQRhFrgOHwnPIn9lDKlk=
github.com/jackc/chunkreader/v2 v2.0.1 h1:i+RDz65UE+mmpjTfyz0MoVTnzeYxroil2G82ki7MGG8=