1.6 KiB
1.6 KiB
Task 0.2.2: Create Config Interface
Metadata
- Task ID: 0.2.2
- Title: Create Config Interface
- Phase: 0 - Project Setup & Foundation
- Section: 0.2 Configuration System
- Status: Pending
- Priority: High
- Estimated Time: 15 minutes
- Dependencies: 0.2.1
Description
Create the ConfigProvider interface in pkg/config/ to abstract configuration access. This interface will be used by all modules and services.
Requirements
- Define interface in
pkg/config/config.go - Include methods for type-safe access
- Support nested configuration keys
- Support unmarshaling into structs
Implementation Steps
- Create
pkg/config/config.go - Define
ConfigProviderinterface:type ConfigProvider interface { Get(key string) any Unmarshal(v any) error GetString(key string) string GetInt(key string) int GetBool(key string) bool GetStringSlice(key string) []string } - Add package documentation
- Export interface for use by modules
Acceptance Criteria
pkg/config/config.goexistsConfigProviderinterface is defined- Interface methods match requirements
- Package documentation is present
- Interface compiles without errors
Related ADRs
Implementation Notes
- Interface should be minimal and focused
- Additional methods can be added later if needed
- Consider adding
GetDuration()for time.Duration values - Consider adding
IsSet(key string) boolto check if key exists
Testing
go build ./pkg/config
go vet ./pkg/config