Skip to content

Commit

Permalink
add constructor that doesnt mess with datastore keys
Browse files Browse the repository at this point in the history
This commit was moved from ipfs/go-ipfs-blockstore@c560386
  • Loading branch information
whyrusleeping committed Aug 2, 2021
1 parent 10c9d33 commit 999b9e0
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions blockstore/blockstore.go
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,16 @@ func NewBlockstore(d ds.Batching) Blockstore {
}
}

// NewBlockstoreNoPrefix returns a default Blockstore implementation
// using the provided datastore.Batching backend.
// This constructor does not modify input keys in any way
func NewBlockstoreNoPrefix(d ds.Batching) Blockstore {
return &blockstore{
datastore: d,
rehash: uatomic.NewBool(false),
}
}

type blockstore struct {
datastore ds.Batching

Expand Down

0 comments on commit 999b9e0

Please sign in to comment.