kubo/thirdparty/datastore2/threadsafe.go
Łukasz Magiera 6401a9191e gx: Update go-datastore to 1.4.0
License: MIT
Signed-off-by: Łukasz Magiera <magik6k@gmail.com>
2017-12-02 14:55:26 -08:00

23 lines
532 B
Go

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