MCPcopy
hub / github.com/perkeep/perkeep / newIndex

Function newIndex

pkg/blobserver/diskpacked/diskpacked.go:151–159  ·  view source on GitHub ↗

newIndex returns a new sorted.KeyValue, using either the given config, or the default.

(root string, indexConf jsonconfig.Obj)

Source from the content-addressed store, hash-verified

149
150// newIndex returns a new sorted.KeyValue, using either the given config, or the default.
151func 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

Callers 2

ReindexFunction · 0.85
newStorageFunction · 0.85

Calls 1

NewKeyValueMaybeWipeFunction · 0.92

Tested by

no test coverage detected