Skip to content

Commit

Permalink
Merge pull request #33 from blugelabs/config-with-custom-directory
Browse files Browse the repository at this point in the history
method to create config with custom diredtory
  • Loading branch information
mschoch authored Oct 6, 2020
2 parents e32d4b0 + 3b3051c commit 43335cc
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
4 changes: 4 additions & 0 deletions config.go
Original file line number Diff line number Diff line change
Expand Up @@ -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{
Expand Down
6 changes: 6 additions & 0 deletions index/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 43335cc

Please sign in to comment.