From 0d1559764d0138b839a3f768d4f4ea36c4f9b9c4 Mon Sep 17 00:00:00 2001 From: Armon Dadgar Date: Wed, 15 Oct 2014 14:55:04 -0700 Subject: [PATCH] consul: Allow providing a path for the state store --- consul/state_store.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/consul/state_store.go b/consul/state_store.go index 0ce993fe2..cd78f1ecb 100644 --- a/consul/state_store.go +++ b/consul/state_store.go @@ -107,7 +107,12 @@ func NewStateStore(logOutput io.Writer) (*StateStore, error) { if err != nil { return nil, err } + return NewStateStorePath(path, logOutput) +} +// NewStateStorePath is used to create a new state store at a given path +// The path is cleared on closing. +func NewStateStorePath(path string, logOutput io.Writer) (*StateStore, error) { // Open the env env, err := mdb.NewEnv() if err != nil {