kubo/thirdparty/datastore2/threadsafe.go
Jeromy d7dab3afea Use gx vendored go-ipfs-utils where possible
For the rest of the packages in util, move them to thirdparty
and update the references. util is gone!

License: MIT
Signed-off-by: Jeromy <jeromyj@gmail.com>
2016-02-12 17:21:40 -08:00

23 lines
539 B
Go

package datastore2
import (
"io"
"github.com/ipfs/go-ipfs/Godeps/_workspace/src/github.com/ipfs/go-datastore"
)
// ClaimThreadSafe claims that a Datastore is threadsafe, even when
// it's type does not guarantee this. Use carefully.
type ClaimThreadSafe struct {
datastore.Batching
}
var _ datastore.ThreadSafeDatastore = ClaimThreadSafe{}
func (ClaimThreadSafe) IsThreadSafe() {}
// TEMP UNTIL dev0.4.0 merges and solves this ugly interface stuff
func (c ClaimThreadSafe) Close() error {
return c.Batching.(io.Closer).Close()
}