github.com/ronaksoft/rony@v0.16.26-0.20230807065236-1743dbfe6959/store/config.go (about) 1 package store 2 3 import ( 4 "time" 5 ) 6 7 /* 8 Creation Time: 2020 - Nov - 10 9 Created by: (ehsan) 10 Maintainers: 11 1. Ehsan N. Moosa (E2) 12 Auditor: Ehsan N. Moosa (E2) 13 Copyright Ronak Software Group 2020 14 */ 15 16 const ( 17 defaultConflictRetries = 100 18 defaultMaxInterval = time.Millisecond 19 defaultBatchWorkers = 16 20 defaultBatchSize = 256 21 ) 22 23 type Config struct { 24 DirPath string 25 ConflictRetries int 26 ConflictMaxInterval time.Duration 27 BatchWorkers int 28 BatchSize int 29 InMemory bool 30 } 31 32 func DefaultConfig(dataPath string) Config { 33 return Config{ 34 DirPath: dataPath, 35 ConflictRetries: 100, 36 ConflictMaxInterval: time.Millisecond, 37 BatchSize: defaultBatchSize, 38 BatchWorkers: defaultBatchWorkers, 39 InMemory: false, 40 } 41 }