Skip to content

Commit 01affd7

Browse files
committed
Initial Commit
0 parents  commit 01affd7

File tree

19 files changed

+2772
-0
lines changed

19 files changed

+2772
-0
lines changed

.gitignore

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
# Binaries
2+
bin/
3+
*.exe
4+
*.exe~
5+
*.dll
6+
*.so
7+
*.dylib
8+
9+
# Test coverage
10+
*.out
11+
coverage.html
12+
13+
# Go workspace files
14+
go.work
15+
go.work.sum
16+
17+
# IDE
18+
.vscode/
19+
.idea/
20+
*.swp
21+
*.swo
22+
*~
23+
24+
# OS
25+
.DS_Store
26+
Thumbs.db
27+
28+
# Environment
29+
.env.local
30+
.env.*.local
31+
.env*
32+
config*

CHANGELOG.md

Lines changed: 156 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,156 @@
1+
# Changelog
2+
3+
All notable changes to ConfigMate will be documented in this file.
4+
5+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6+
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7+
8+
## [Unreleased]
9+
10+
### Planned Features
11+
- TOML file format support
12+
- Remote configuration sources (HTTP, S3)
13+
- Configuration encryption/decryption
14+
- Configuration schema validation
15+
- Web UI for configuration management
16+
17+
## [1.0.0] - 2025-10-19
18+
19+
### Added
20+
- Initial release of ConfigMate
21+
- Multi-source configuration loading (.env, JSON, YAML)
22+
- Struct-based type-safe configuration
23+
- Environment variable override support
24+
- Required field validation
25+
- Default values via struct tags
26+
- Hot reload with file watching
27+
- Configuration caching with TTL
28+
- Structured logging interface
29+
- Metrics collection
30+
- Context support for timeouts/cancellation
31+
- Security features (path traversal protection, file size limits)
32+
- Comprehensive test suite (>85% coverage)
33+
- Example application
34+
- Documentation (README, CONTRIBUTING, CODE_OF_CONDUCT)
35+
36+
### Features in Detail
37+
38+
#### Core Functionality
39+
- **Multi-format Support**: Load from .env, JSON, and YAML files
40+
- **Type Safety**: Compile-time type checking with struct tags
41+
- **Validation**: Required fields and default values
42+
- **Precedence**: Configurable source precedence (defaults → files → env)
43+
44+
#### Advanced Features
45+
- **Hot Reload**: Watch files for changes and auto-reload
46+
- **Caching**: Optional configuration caching with configurable TTL
47+
- **Security**: Built-in path validation and file size limits
48+
- **Context Support**: Timeout and cancellation support
49+
- **Logging**: Structured logging with configurable levels
50+
- **Metrics**: Track load count, errors, cache hits, etc.
51+
52+
#### Developer Experience
53+
- **Clean API**: Simple `Load()` function for basic use
54+
- **Flexible Options**: Functional options pattern for advanced config
55+
- **Great Documentation**: Comprehensive README with examples
56+
- **Well Tested**: >85% test coverage with benchmarks
57+
58+
### Configuration Options
59+
- `WithPrefix(string)` - Set environment variable prefix
60+
- `WithWatch(bool)` - Enable file watching
61+
- `WithCache(bool)` - Enable configuration caching
62+
- `WithCacheTTL(duration)` - Set cache expiration
63+
- `WithLogger(Logger)` - Custom logger
64+
- `WithMetrics(Metrics)` - Custom metrics collector
65+
- `WithSecureMode(bool)` - Enable security checks
66+
- `WithOnReload(func)` - Reload callback
67+
- `WithEnvOverride(bool)` - ENV override behavior
68+
- `WithFailOnMissingFile(bool)` - File existence checking
69+
- `WithValidator(func)` - Custom validation
70+
71+
### Security
72+
- Path traversal attack prevention
73+
- Maximum file size enforcement (10MB default)
74+
- Extension whitelist (.env, .json, .yaml, .yml only)
75+
- Path depth limits
76+
- Secure default configuration
77+
78+
### Documentation
79+
- Comprehensive README with examples
80+
- API documentation with godoc
81+
- Contributing guidelines
82+
- Code of conduct
83+
- Example application
84+
- Troubleshooting guide
85+
86+
### Testing
87+
- Unit tests for all packages
88+
- Integration tests
89+
- Benchmark tests
90+
- Table-driven tests
91+
- >85% code coverage
92+
93+
## [0.2.0] - 2025-10-15 (Pre-release)
94+
95+
### Added
96+
- Hot reload functionality
97+
- Configuration caching
98+
- Metrics collection
99+
- Logging interface
100+
101+
### Changed
102+
- Refactored internal structure
103+
- Improved error messages
104+
- Enhanced documentation
105+
106+
### Fixed
107+
- Nested struct population bug
108+
- Environment variable mapping for nested structs
109+
- YAML parser handling of maps
110+
111+
## [0.1.0] - 2025-10-10 (Pre-release)
112+
113+
### Added
114+
- Initial development release
115+
- Basic configuration loading
116+
- .env file support
117+
- JSON and YAML support
118+
- Struct tag parsing
119+
- Validation framework
120+
121+
---
122+
123+
## Release Categories
124+
125+
### Added
126+
- New features
127+
128+
### Changed
129+
- Changes to existing functionality
130+
131+
### Deprecated
132+
- Features marked for removal
133+
134+
### Removed
135+
- Removed features
136+
137+
### Fixed
138+
- Bug fixes
139+
140+
### Security
141+
- Security fixes and improvements
142+
143+
---
144+
145+
## Version History
146+
147+
- **1.0.0** - First stable release (2025-10-19)
148+
- **0.2.0** - Pre-release with advanced features (2025-10-15)
149+
- **0.1.0** - Initial development release (2025-10-10)
150+
151+
---
152+
153+
[Unreleased]: https://github.com/psmohan/configmate/compare/v1.0.0...HEAD
154+
[1.0.0]: https://github.com/psmohan/configmate/releases/tag/v1.0.0
155+
[0.2.0]: https://github.com/psmohan/configmate/releases/tag/v0.2.0
156+
[0.1.0]: https://github.com/psmohan/configmate/releases/tag/v0.1.0

CODE_OF_CONDUCT.md

Lines changed: 133 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,133 @@
1+
# Contributor Covenant Code of Conduct
2+
3+
## Our Pledge
4+
5+
We as members, contributors, and leaders pledge to make participation in our
6+
community a harassment-free experience for everyone, regardless of age, body
7+
size, visible or invisible disability, ethnicity, sex characteristics, gender
8+
identity and expression, level of experience, education, socio-economic status,
9+
nationality, personal appearance, race, caste, color, religion, or sexual
10+
identity and orientation.
11+
12+
We pledge to act and interact in ways that contribute to an open, welcoming,
13+
diverse, inclusive, and healthy community.
14+
15+
## Our Standards
16+
17+
Examples of behavior that contributes to a positive environment for our
18+
community include:
19+
20+
* Demonstrating empathy and kindness toward other people
21+
* Being respectful of differing opinions, viewpoints, and experiences
22+
* Giving and gracefully accepting constructive feedback
23+
* Accepting responsibility and apologizing to those affected by our mistakes,
24+
and learning from the experience
25+
* Focusing on what is best not just for us as individuals, but for the overall
26+
community
27+
28+
Examples of unacceptable behavior include:
29+
30+
* The use of sexualized language or imagery, and sexual attention or advances of
31+
any kind
32+
* Trolling, insulting or derogatory comments, and personal or political attacks
33+
* Public or private harassment
34+
* Publishing others' private information, such as a physical or email address,
35+
without their explicit permission
36+
* Other conduct which could reasonably be considered inappropriate in a
37+
professional setting
38+
39+
## Enforcement Responsibilities
40+
41+
Community leaders are responsible for clarifying and enforcing our standards of
42+
acceptable behavior and will take appropriate and fair corrective action in
43+
response to any behavior that they deem inappropriate, threatening, offensive,
44+
or harmful.
45+
46+
Community leaders have the right and responsibility to remove, edit, or reject
47+
comments, commits, code, wiki edits, issues, and other contributions that are
48+
not aligned to this Code of Conduct, and will communicate reasons for moderation
49+
decisions when appropriate.
50+
51+
## Scope
52+
53+
This Code of Conduct applies within all community spaces, and also applies when
54+
an individual is officially representing the community in public spaces.
55+
Examples of representing our community include using an official e-mail address,
56+
posting via an official social media account, or acting as an appointed
57+
representative at an online or offline event.
58+
59+
## Enforcement
60+
61+
Instances of abusive, harassing, or otherwise unacceptable behavior may be
62+
reported to the community leaders responsible for enforcement at
63+
[INSERT CONTACT EMAIL].
64+
65+
All complaints will be reviewed and investigated promptly and fairly.
66+
67+
All community leaders are obligated to respect the privacy and security of the
68+
reporter of any incident.
69+
70+
## Enforcement Guidelines
71+
72+
Community leaders will follow these Community Impact Guidelines in determining
73+
the consequences for any action they deem in violation of this Code of Conduct:
74+
75+
### 1. Correction
76+
77+
**Community Impact**: Use of inappropriate language or other behavior deemed
78+
unprofessional or unwelcome in the community.
79+
80+
**Consequence**: A private, written warning from community leaders, providing
81+
clarity around the nature of the violation and an explanation of why the
82+
behavior was inappropriate. A public apology may be requested.
83+
84+
### 2. Warning
85+
86+
**Community Impact**: A violation through a single incident or series of
87+
actions.
88+
89+
**Consequence**: A warning with consequences for continued behavior. No
90+
interaction with the people involved, including unsolicited interaction with
91+
those enforcing the Code of Conduct, for a specified period of time. This
92+
includes avoiding interactions in community spaces as well as external channels
93+
like social media. Violating these terms may lead to a temporary or permanent
94+
ban.
95+
96+
### 3. Temporary Ban
97+
98+
**Community Impact**: A serious violation of community standards, including
99+
sustained inappropriate behavior.
100+
101+
**Consequence**: A temporary ban from any sort of interaction or public
102+
communication with the community for a specified period of time. No public or
103+
private interaction with the people involved, including unsolicited interaction
104+
with those enforcing the Code of Conduct, is allowed during this period.
105+
Violating these terms may lead to a permanent ban.
106+
107+
### 4. Permanent Ban
108+
109+
**Community Impact**: Demonstrating a pattern of violation of community
110+
standards, including sustained inappropriate behavior, harassment of an
111+
individual, or aggression toward or disparagement of classes of individuals.
112+
113+
**Consequence**: A permanent ban from any sort of public interaction within the
114+
community.
115+
116+
## Attribution
117+
118+
This Code of Conduct is adapted from the [Contributor Covenant][homepage],
119+
version 2.1, available at
120+
[https://www.contributor-covenant.org/version/2/1/code_of_conduct.html][v2.1].
121+
122+
Community Impact Guidelines were inspired by
123+
[Mozilla's code of conduct enforcement ladder][Mozilla CoC].
124+
125+
For answers to common questions about this code of conduct, see the FAQ at
126+
[https://www.contributor-covenant.org/faq][FAQ]. Translations are available at
127+
[https://www.contributor-covenant.org/translations][translations].
128+
129+
[homepage]: https://www.contributor-covenant.org
130+
[v2.1]: https://www.contributor-covenant.org/version/2/1/code_of_conduct.html
131+
[Mozilla CoC]: https://github.com/mozilla/diversity
132+
[FAQ]: https://www.contributor-covenant.org/faq
133+
[translations]: https://www.contributor-covenant.org/translations

0 commit comments

Comments
 (0)