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

feat(bolt-options): add bolt options to db.Init #430

Merged
merged 4 commits into from
Aug 29, 2024
Merged

Conversation

orizerah
Copy link
Contributor

#429

add bbolt.Options to db.Init arguments for a more customizable db

@orizerah orizerah requested a review from knqyf263 as a code owner August 25, 2024 09:50
pkg/db/db.go Outdated
@@ -55,7 +55,7 @@ type Operation interface {
type Config struct {
}

func Init(dbDir string) (err error) {
func Init(dbDir string, dbOpts *bolt.Options) (err error) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Trivy doesn't need bolt.Options. What if using Functional Option Pattern?
e.g.

func WithClock(clock clock.Clock) Option {
return func(core *TrivyDB) {
core.clock = clock
}
}

@knqyf263 knqyf263 requested a review from DmitriyLewen August 27, 2024 03:31
Copy link
Contributor

@DmitriyLewen DmitriyLewen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@knqyf263 knqyf263 merged commit 5efa8c8 into main Aug 29, 2024
3 checks passed
@knqyf263 knqyf263 deleted the feat/add-bolt-options branch August 29, 2024 10:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants