1
0
mirror of https://github.com/ipfs/kubo.git synced 2025-05-17 23:16:11 +08:00
Files
kubo/thirdparty/datastore2/threadsafe.go
Hector Sanjuan 3ee1d76d88 Update to latest go-datastore
License: MIT
Signed-off-by: Hector Sanjuan <hector@protocol.ai>
2018-03-26 22:12:14 +02:00

23 lines
532 B
Go

package datastore2
import (
"io"
"gx/ipfs/QmXRKBQA4wXP7xWbFiZsR1GP4HV6wMDQ1aWFxZZ4uBcPX9/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()
}