newIndex returns a new sorted.KeyValue, using either the given config, or the default.
(root string, indexConf jsonconfig.Obj)
| 149 | |
| 150 | // newIndex returns a new sorted.KeyValue, using either the given config, or the default. |
| 151 | func newIndex(root string, indexConf jsonconfig.Obj) (sorted.KeyValue, error) { |
| 152 | if len(indexConf) > 0 { |
| 153 | return sorted.NewKeyValueMaybeWipe(indexConf) |
| 154 | } |
| 155 | return sorted.NewKeyValueMaybeWipe(jsonconfig.Obj{ |
| 156 | "type": defaultIndexType, |
| 157 | "file": filepath.Join(root, defaultIndexFile), |
| 158 | }) |
| 159 | } |
| 160 | |
| 161 | // newStorage returns a new storage in path root with the given maxFileSize, |
| 162 | // or defaultMaxFileSize (512MB) if <= 0 |
no test coverage detected