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

refactor: use functional options pattern for config #11

Merged
merged 1 commit into from
Aug 6, 2024

Conversation

dirodriguezm
Copy link
Collaborator

Implementation of the functional options pattern.

It allows to configure the server like this

var config tapsync.Config
config = tapsync.NewConfig() // by default config uses env variable for DB url
// but can also be configured like this
config = tapsync.NewConfig(WithDatabaseURL("url"), WithPort(5000))
service := tapsync.NewTapSyncService(config)

@dirodriguezm dirodriguezm merged commit 4bc81fc into main Aug 6, 2024
1 check passed
@dirodriguezm dirodriguezm deleted the functional-options branch August 6, 2024 12:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant