Skip to content

Commit

Permalink
Merge pull request ipfs/go-ipfs-blockstore#83 from ipfs/feat/no-prefi…
Browse files Browse the repository at this point in the history
…x-constructor

add constructor that doesnt mess with datastore keys

This commit was moved from ipfs/go-ipfs-blockstore@b57a17e
  • Loading branch information
Stebalien committed Aug 3, 2021
2 parents 10c9d33 + 999b9e0 commit afca13b
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 afca13b

Please sign in to comment.