diff --git a/go/datas/factory.go b/go/datas/factory.go index 62996bf226..a3f3fa1be6 100644 --- a/go/datas/factory.go +++ b/go/datas/factory.go @@ -14,17 +14,21 @@ type Factory interface { Shutter() } -type localFactory struct { +type LocalFactory struct { cf chunks.Factory } -func (lf *localFactory) Create(ns string) (Database, bool) { +func NewLocalFactory(cf chunks.Factory) *LocalFactory { + return &LocalFactory{cf} +} + +func (lf *LocalFactory) Create(ns string) (Database, bool) { if cs := lf.cf.CreateStore(ns); cs != nil { return newLocalDatabase(cs), true } return &LocalDatabase{}, false } -func (lf *localFactory) Shutter() { +func (lf *LocalFactory) Shutter() { lf.cf.Shutter() }