From 3b3051cc3b34848964f59a3ff891b44ff2d56cc2 Mon Sep 17 00:00:00 2001 From: Marty Schoch Date: Tue, 6 Oct 2020 09:09:42 -0400 Subject: [PATCH] method to create config with custom diredtory --- config.go | 4 ++++ index/config.go | 6 ++++++ 2 files changed, 10 insertions(+) diff --git a/config.go b/config.go index 70f4c1f..7f21dc7 100644 --- a/config.go +++ b/config.go @@ -89,6 +89,10 @@ func InMemoryOnlyConfig() Config { indexConfig := index.InMemoryOnlyConfig() return defaultConfig(indexConfig) } +func DefaultConfigWithDirectory(df func() index.Directory) Config { + indexConfig := index.DefaultConfigWithDirectory(df) + return defaultConfig(indexConfig) +} func defaultConfig(indexConfig index.Config) Config { rv := Config{ diff --git a/index/config.go b/index/config.go index 65bf914..c7217cd 100644 --- a/index/config.go +++ b/index/config.go @@ -145,6 +145,12 @@ func InMemoryOnlyConfig() Config { return rv } +func DefaultConfigWithDirectory(df func() Directory) Config { + rv := defaultConfig() + rv.DirectoryFunc = df + return rv +} + func defaultConfig() Config { rv := Config{ SegmentType: ice.Type,