[#220] shard: Enable write cache through option

Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
This commit is contained in:
Leonard Lyubich 2020-11-30 19:55:21 +03:00 committed by Alex Vanin
parent 47d2239332
commit cbdcfb9159

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
}
}