-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into bloxico/cli-sync-tests
- Loading branch information
Showing
51 changed files
with
2,337 additions
and
140 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
package blockstore | ||
|
||
import ( | ||
"context" | ||
) | ||
|
||
type hotViewKey struct{} | ||
|
||
var hotView = hotViewKey{} | ||
|
||
// WithHotView constructs a new context with an option that provides a hint to the blockstore | ||
// (e.g. the splitstore) that the object (and its ipld references) should be kept hot. | ||
func WithHotView(ctx context.Context) context.Context { | ||
return context.WithValue(ctx, hotView, struct{}{}) | ||
} | ||
|
||
// IsHotView returns true if the hot view option is set in the context | ||
func IsHotView(ctx context.Context) bool { | ||
v := ctx.Value(hotView) | ||
return v != nil | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.