Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

keep creation can now optionally augment Config{} #12

Merged
merged 1 commit into from
Sep 1, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
11 changes: 11 additions & 0 deletions keep.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,10 @@ type Keep struct {
}

func NewKeep(settings engine.Settings) (*Keep, error) {
return NewKeepWithConfig(settings, nil)
}

func NewKeepWithConfig(settings engine.Settings, augment func(*config.Config) error) (*Keep, error) {
settings.ConfigFile = ConfigFile(settings.ConfigFile)

var conf config.Config
Expand All @@ -49,6 +53,13 @@ func NewKeep(settings engine.Settings) (*Keep, error) {
return keep, err
}

if augment != nil {
err := augment(&keep.Config)
if err != nil {
return nil, err
}
}

if err := keep.setupExchanges(GCTLog{nil}); err != nil {
return keep, err
}
Expand Down