[#222] Rename WithTreeRoot.. to WithRoot.. in blobstor opts

Signed-off-by: Alex Vanin <alexey@nspcc.ru>
This commit is contained in:
Alex Vanin 2020-12-01 12:50:16 +03:00
parent d4e48b28b1
commit f45b7a048d
3 changed files with 8 additions and 8 deletions

View file

@ -510,9 +510,9 @@ func initShardOptions(c *cfg) {
opts = append(opts, []shard.Option{
shard.WithLogger(c.log),
shard.WithBlobStorOptions(
blobstor.WithTreeRootPath(blobPath),
blobstor.WithRootPath(blobPath),
blobstor.WithCompressObjects(compressObjects, c.log),
blobstor.WithTreeRootPerm(blobPerm),
blobstor.WithRootPerm(blobPerm),
blobstor.WithShallowDepth(shallowDepth),
blobstor.WithSmallSizeLimit(smallSzLimit),
blobstor.WithBlobovniczaSize(blzSize),
@ -528,7 +528,7 @@ func initShardOptions(c *cfg) {
),
shard.WithWriteCache(useCache),
shard.WithWriteCacheOptions(
blobstor.WithTreeRootPath(writeCachePath),
blobstor.WithRootPath(writeCachePath),
),
})

View file

@ -67,7 +67,7 @@ func TestBlobovniczas(t *testing.T) {
WithSmallSizeLimit(szLim),
WithBlobovniczaShallowWidth(width),
WithBlobovniczaShallowDepth(depth),
WithTreeRootPath(p),
WithRootPath(p),
WithBlobovniczaSize(szLim),
} {
opt(c)

View file

@ -131,18 +131,18 @@ func WithCompressObjects(comp bool, log *logger.Logger) Option {
}
}
// WithTreeRootPath returns option to set path to root directory
// WithRootPath returns option to set path to root directory
// of the fs tree to write the objects.
func WithTreeRootPath(rootDir string) Option {
func WithRootPath(rootDir string) Option {
return func(c *cfg) {
c.fsTree.RootPath = rootDir
c.blzRootPath = path.Join(rootDir, blobovniczaDir)
}
}
// WithTreeRootPerm returns option to set permission
// WithRootPerm returns option to set permission
// bits of the fs tree.
func WithTreeRootPerm(perm os.FileMode) Option {
func WithRootPerm(perm os.FileMode) Option {
return func(c *cfg) {
c.fsTree.Permissions = perm
c.blzOpts = append(c.blzOpts, blobovnicza.WithPermissions(perm))