Skip to content
This repository has been archived by the owner on Jun 19, 2023. It is now read-only.

add constructor that doesnt mess with datastore keys #83

Merged
merged 1 commit into from
Aug 3, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions 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