github.com/keltia/go-ipfs@v0.3.8-0.20150909044612-210793031c63/util/testutil/datastore.go (about)

     1  package testutil
     2  
     3  import (
     4  	"github.com/ipfs/go-ipfs/Godeps/_workspace/src/github.com/jbenet/go-datastore"
     5  	syncds "github.com/ipfs/go-ipfs/Godeps/_workspace/src/github.com/jbenet/go-datastore/sync"
     6  	ds2 "github.com/ipfs/go-ipfs/util/datastore2"
     7  )
     8  
     9  func ThreadSafeCloserMapDatastore() ds2.ThreadSafeDatastoreCloser {
    10  	return ds2.CloserWrap(syncds.MutexWrap(datastore.NewMapDatastore()))
    11  }