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

Configs and Log Refractor #53

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

srivastava-yash
Copy link

@srivastava-yash srivastava-yash commented Oct 28, 2024

Closes #44

  • Standardise config load at init of server and avoid config.LoadConfig calls across the service.
  • Standardise log library

@srivastava-yash
Copy link
Author

@lucifercr07, I have implemented the configs refractor and also added a logging package. I was not entirely sure about the logging package. Happy to hear your suggestions and comments on changing anything.

@srivastava-yash srivastava-yash marked this pull request as draft October 29, 2024 05:05
@srivastava-yash srivastava-yash marked this pull request as ready for review October 29, 2024 06:22
@@ -7,8 +7,7 @@ import (

// Updated enableCors function to return a boolean indicating if OPTIONS was handled
func handleCors(w http.ResponseWriter, r *http.Request) bool {
configValue := config.LoadConfig()
allAllowedOrigins := configValue.Server.AllowedOrigins
allAllowedOrigins := config.AppConfig.Server.AllowedOrigins
Copy link
Author

Choose a reason for hiding this comment

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

Not sure why linter is failing here even though the config.LoadConfig is changed here..getting linter error where this function is called in internal/middleware/ratelimiter.go

@lucifercr07
Copy link
Contributor

@srivastava-yash can you please fix the build and lint issue.

@srivastava-yash
Copy link
Author

Sorry for the delay on this @lucifercr07 , I was traveling. When I am running the lint command locally, I am not getting any errors. I am not sure why linter is failing, I had mentioned this in a comment earlier as well. I will try to debug this.

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.

Remove redundant usage of config load across codebase and refactor logging
2 participants