refactor: encapsulate pulling in a struct

refs #10
This commit is contained in:
Christian Schwarz
2017-12-24 15:05:07 +01:00
parent 2716c75ad5
commit 583a63a68f
4 changed files with 41 additions and 21 deletions

View File

@ -52,14 +52,14 @@ func closeRPCWithTimeout(log Logger, remote rpc.RPCClient, timeout time.Duration
return
}
type PullContext struct {
type Puller struct {
Remote rpc.RPCClient
Log Logger
Mapping DatasetMapping
InitialReplPolicy InitialReplPolicy
}
func doPull(pull PullContext) (err error) {
func (pull *Puller) doPull() (err error) {
remote := pull.Remote
log := pull.Log