Skip to content

Develop#2

Merged
ralvescosta merged 7 commits intomainfrom
develop
May 25, 2025
Merged

Develop#2
ralvescosta merged 7 commits intomainfrom
develop

Conversation

@ralvescosta
Copy link
Copy Markdown
Member

This pull request introduces significant changes to the configuration system, enhancing environment variable support, improving type safety, and removing unused or redundant configurations. Key updates include transitioning fields to use mapstructure and envconfig tags, replacing integer-based enums with string-based enums, and adding comprehensive tests for configuration loading. Additionally, some unused configuration structs have been removed.

Enhancements to configuration structures:

  • Updated AppConfigs to include new fields (Namespace, Host, Port) and added mapstructure and envconfig tags for environment variable binding. ([app.goR11-R54](https://github.com/goxkit/configs/pull/2/files#diff-6c4b6ed7dc8834cef100f50dae61c30ffe7775a3f3f6f5a557517cb740c44a2dR11-R54))
  • Replaced integer-based enums with string-based enums for Environment and LogLevel to improve readability and type safety. ([[1]](https://github.com/goxkit/configs/pull/2/files#diff-91eb70f1e3dac1f0e5c0a6e789ade926700e4500eadc5304502322b5ace008dfR7-R25), [[2]](https://github.com/goxkit/configs/pull/2/files#diff-b6729dc94d8e7b958d4bfab37dca16bf8d2cf32ca079547b21f91ce78b8d6776L9-R21))
  • Updated AWSConfigs, IdentityConfigs, and KafkaConfigs to support environment variable bindings using mapstructure and envconfig tags. ([[1]](https://github.com/goxkit/configs/pull/2/files#diff-154b151b1a93f1cf611c8e2218f9aa40ccb227bae87071be7f82237e1c4649d3R10-R38), [[2]](https://github.com/goxkit/configs/pull/2/files#diff-2de96e48bc2537386b67ba8481b1566bbc2876c46b0b36a7dfd9cadd55f3a050R10-R53), [[3]](https://github.com/goxkit/configs/pull/2/files#diff-9e1a248f742004580cd6ee82db292e4c34e950881151854a568042623929e89bR10-R55))

Removal of unused configurations:

  • Removed Auth0Configs and MetricsConfigs as they were no longer in use. ([[1]](https://github.com/goxkit/configs/pull/2/files#diff-767d67ed1ec7b4c07212bd3b1289b65977c604e8446804442e26a34f52978eceL1-L18), [[2]](https://github.com/goxkit/configs/pull/2/files#diff-368a9e52513f8700cc50c424de862c537fc5c1a492c4598b97b960f46fc1c877L1-L31))

Improvements to testing:

  • Added TestAppConfigsWithViper to validate configuration loading from .env.local files and ensure proper handling of environment variables. ([app_test.goR1-R124](https://github.com/goxkit/configs/pull/2/files#diff-65409e14d57dfeeef8ef8a499ca2eb193731e4a33b6ae6a83fc83eebef4e015eR1-R124))

Structural changes:

  • Replaced zap.SugaredLogger with zap.Logger in Configs for better logging performance. ([configs.goL17-R17](https://github.com/goxkit/configs/pull/2/files#diff-c4ae2ab10cb4bf7482e3ad3e932a053820c7c06838bcc5498b1cf2847328544dL17-R17))
  • Removed unused fields (MetricsConfigs, TracingConfigs, Auth0Configs) from the Configs struct and introduced OTLPConfigs and PostgresConfigs. ([configs.goL27-L36](https://github.com/goxkit/configs/pull/2/files#diff-c4ae2ab10cb4bf7482e3ad3e932a053820c7c06838bcc5498b1cf2847328544dL27-L36))

Minor updates:

  • Updated go.mod to use Go version 1.24.3. ([go.modL3-R3](https://github.com/goxkit/configs/pull/2/files#diff-33ef32bf6c23acb95f5902d7097b7a1d5128ca061167ec0716715b0b9eeaa5f6L3-R3))

@ralvescosta ralvescosta self-assigned this May 25, 2025
@ralvescosta ralvescosta merged commit 99908df into main May 25, 2025
4 checks passed
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