rpc: Initial|IncrementalTransferRequest transfer zfs data structures

This commit is contained in:
Christian Schwarz 2017-05-07 12:04:16 +02:00
parent fa97d3d98a
commit cd8796aed4
3 changed files with 9 additions and 17 deletions

View File

@ -19,12 +19,10 @@ func (h Handler) HandleFilesystemVersionsRequest(r rpc.FilesystemVersionsRequest
return
}
func (h Handler) HandleInitialTransferRequest(r rpc.InitialTransferRequest) (io.Reader, error) {
// TODO ACL
return zfs.InitialSend(r.Snapshot)
func (h Handler) HandleInitialTransferRequest(r rpc.InitialTransferRequest) (stream io.Reader, err error) {
return
}
func (h Handler) HandleIncrementalTransferRequest(r rpc.IncrementalTransferRequest) (io.Reader, error) {
// TODO ACL
return zfs.IncrementalSend(r.FromSnapshot, r.ToSnapshot)
func (h Handler) HandleIncrementalTransferRequest(r rpc.IncrementalTransferRequest) (stream io.Reader, err error) {
return
}

View File

@ -36,7 +36,8 @@ type FilesystemVersionsRequest struct {
}
type InitialTransferRequest struct {
Snapshot string // tank/my/db@ljlsdjflksdf
Filesystem zfs.DatasetPath
FilesystemVersion zfs.FilesystemVersion
}
func (r InitialTransferRequest) Respond(snapshotReader io.Reader) {
@ -44,8 +45,9 @@ func (r InitialTransferRequest) Respond(snapshotReader io.Reader) {
}
type IncrementalTransferRequest struct {
FromSnapshot string
ToSnapshot string
Filesystem zfs.DatasetPath
From zfs.FilesystemVersion
To zfs.FilesystemVersion
}
func (r IncrementalTransferRequest) Respond(snapshotReader io.Reader) {

View File

@ -10,14 +10,6 @@ import (
"strings"
)
func InitialSend(snapshot string) (io.Reader, error) {
return nil, nil
}
func IncrementalSend(from, to string) (io.Reader, error) {
return nil, nil
}
type DatasetPath []string
func (p DatasetPath) ToString() string {