From 77f749112ced293f0410f513308bd3b104cf50c6 Mon Sep 17 00:00:00 2001 From: Christian Schwarz Date: Wed, 3 May 2017 17:38:11 +0200 Subject: [PATCH] main: remove global handler and unused structs --- cmd/handler.go | 5 ++++- cmd/main.go | 20 +------------------- 2 files changed, 5 insertions(+), 20 deletions(-) diff --git a/cmd/handler.go b/cmd/handler.go index 3a784e1..e45242d 100644 --- a/cmd/handler.go +++ b/cmd/handler.go @@ -6,7 +6,10 @@ import ( "io" ) -type Handler struct{} +type Handler struct { + PushMapping zfs.DatasetMapping + PullMapping zfs.DatasetMapping +} func (h Handler) HandleFilesystemRequest(r rpc.FilesystemRequest) (roots []zfs.DatasetPath, err error) { return diff --git a/cmd/main.go b/cmd/main.go index f50cad4..6c77dda 100644 --- a/cmd/main.go +++ b/cmd/main.go @@ -5,22 +5,11 @@ import ( "fmt" "github.com/urfave/cli" "github.com/zrepl/zrepl/jobrun" - "github.com/zrepl/zrepl/rpc" - "github.com/zrepl/zrepl/sshbytestream" - "io" "sync" "time" ) -type Role uint - -const ( - ROLE_IPC Role = iota - ROLE_ACTION Role = iota -) - var conf Config -var handler Handler var runner *jobrun.JobRunner func main() { @@ -40,7 +29,6 @@ func main() { if conf, err = ParseConfig(c.GlobalString("config")); err != nil { return } - handler = Handler{} runner = jobrun.NewJobRunner() return @@ -68,13 +56,7 @@ func main() { } func doSink(c *cli.Context) (err error) { - - var sshByteStream io.ReadWriteCloser - if sshByteStream, err = sshbytestream.Incoming(); err != nil { - return - } - - return rpc.ListenByteStreamRPC(sshByteStream, handler) + return } func doRun(c *cli.Context) error {