Skip to content

refactor: extract configuration management into separate package#3

Open
pomadev wants to merge 1 commit intomainfrom
refactor/extract-config-management
Open

refactor: extract configuration management into separate package#3
pomadev wants to merge 1 commit intomainfrom
refactor/extract-config-management

Conversation

@pomadev
Copy link
Owner

@pomadev pomadev commented Jun 4, 2025

Summary

  • Extract all configuration logic into a dedicated config package
  • Centralize environment variable parsing and validation
  • Improve separation of concerns

Changes

  • config/config.go: New package with Config struct and Load() function
  • function.go: Use config.Load() instead of manual env var parsing
  • client/client.go: Accept *config.Config instead of individual parameters

Benefits

  • Single source of truth for configuration
  • Easier to test (can mock Config struct)
  • Better validation with descriptive error messages
  • Cleaner code with less repetition
  • Easier to add new configuration options in the future

🤖 Generated with Claude Code

- Create new config package with Config struct and Load function
- Move all environment variable parsing to config.Load()
- Add configuration validation
- Update client.CreateClient to accept Config instead of string
- Centralize all configuration logic in one place

This improves code organization and makes configuration management more maintainable and testable.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
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.

1 participant

Comments