consul: Allow providing a path for the state store
This commit is contained in:
parent
88b53702f1
commit
0d1559764d
|
@ -107,7 +107,12 @@ func NewStateStore(logOutput io.Writer) (*StateStore, error) {
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
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
|
// Open the env
|
||||||
env, err := mdb.NewEnv()
|
env, err := mdb.NewEnv()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|
Loading…
Reference in New Issue