main: remove global handler and unused structs

This commit is contained in:
Christian Schwarz 2017-05-03 17:38:11 +02:00
parent f005ce318d
commit 77f749112c
2 changed files with 5 additions and 20 deletions

View File

@ -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

View File

@ -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,15 +56,9 @@ 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)
}
func doRun(c *cli.Context) error {
// Do every pull, do every push