consul: Allow providing a path for the state store

This commit is contained in:
Armon Dadgar 2014-10-15 14:55:04 -07:00
parent f8fc46dc57
commit be8051ec7e
1 changed files with 5 additions and 0 deletions

View File

@ -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 {