From 59e34942d1d8d15df607907e26dcabd5f58ad4c4 Mon Sep 17 00:00:00 2001 From: Christian Schwarz Date: Tue, 26 Dec 2017 20:43:15 +0100 Subject: [PATCH] Puller: make main interface public refs #10 --- cmd/config_job_local.go | 4 ++-- cmd/config_job_pull.go | 2 +- cmd/replication.go | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/cmd/config_job_local.go b/cmd/config_job_local.go index afefdec..bfdb26d 100644 --- a/cmd/config_job_local.go +++ b/cmd/config_job_local.go @@ -148,10 +148,10 @@ outer: log := pullCtx.Value(contextKeyLog).(Logger) log.Debug("replicating from lhs to rhs") puller := Puller{j.replTask, local, log, j.Mapping, j.InitialReplPolicy} - if err := puller.doPull(); err != nil { + if err := puller.Pull(); err != nil { log.WithError(err).Error("error replicating lhs to rhs") } - // use a ctx as soon as doPull gains ctx support + // use a ctx as soon as Pull gains ctx support select { case <-ctx.Done(): break outer diff --git a/cmd/config_job_pull.go b/cmd/config_job_pull.go index a7abd95..18ea7ab 100644 --- a/cmd/config_job_pull.go +++ b/cmd/config_job_pull.go @@ -125,7 +125,7 @@ start: pullLog := log.WithField(logTaskField, "pull") puller := Puller{j.task, client, pullLog, j.Mapping, j.InitialReplPolicy} - if err = puller.doPull(); err != nil { + if err = puller.Pull(); err != nil { log.WithError(err).Error("error doing pull") } diff --git a/cmd/replication.go b/cmd/replication.go index 16fffe8..9825250 100644 --- a/cmd/replication.go +++ b/cmd/replication.go @@ -60,7 +60,7 @@ type Puller struct { InitialReplPolicy InitialReplPolicy } -func (pull *Puller) doPull() (err error) { +func (pull *Puller) Pull() (err error) { remote := pull.Remote log := pull.Log