initial repl policy: get rid of unimplemented options

This commit is contained in:
Christian Schwarz
2018-08-25 22:23:47 +02:00
parent 861e5f8313
commit 88de8ba8bb
9 changed files with 4 additions and 60 deletions

View File

@ -4,11 +4,10 @@ import (
"io/ioutil"
"fmt"
yaml "github.com/go-yaml/yaml"
"github.com/go-yaml/yaml"
"github.com/mitchellh/mapstructure"
"github.com/pkg/errors"
"github.com/problame/go-streamrpc"
"github.com/zrepl/zrepl/replication"
"os"
"regexp"
"strconv"
@ -228,30 +227,6 @@ func parseConnect(i map[string]interface{}) (c streamrpc.Connecter, err error) {
}
func parseInitialReplPolicy(v interface{}, defaultPolicy replication.InitialReplPolicy) (p replication.InitialReplPolicy, err error) {
s, ok := v.(string)
if !ok {
goto err
}
switch {
case s == "":
p = defaultPolicy
case s == "most_recent":
p = replication.InitialReplPolicyMostRecent
case s == "all":
p = replication.InitialReplPolicyAll
default:
goto err
}
return
err:
err = errors.New(fmt.Sprintf("expected InitialReplPolicy, got %#v", v))
return
}
func parsePrunePolicy(v map[string]interface{}, willSeeBookmarks bool) (p PrunePolicy, err error) {
policyName, err := extractStringField(v, "policy", true)