[#220] shard: Enable write cache through option

Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
remotes/KirillovDenis/release/v0.21.1
Leonard Lyubich 2020-11-30 19:55:21 +03:00 committed by Alex Vanin
parent 47d2239332
commit cbdcfb9159
1 changed files with 9 additions and 0 deletions

View File

@ -22,6 +22,8 @@ type Shard struct {
type Option func(*cfg)
type cfg struct {
useWriteCache bool
info Info
blobOpts []blobstor.Option
@ -78,3 +80,10 @@ func WithLogger(l *logger.Logger) Option {
c.log = l
}
}
// WithWriteCache returns option to toggle write cache usage.
func WithWriteCache(use bool) Option {
return func(c *cfg) {
c.useWriteCache = use
}
}