Files
goplt/docs/stories/phase0/0.2.2-create-pkgconfigconfiggo-interface.md
0x1d 6a17236474 docs: add implementation plan, ADRs, and task tracking system
- Add comprehensive 8-phase implementation plan (docs/plan.md)
- Add 28 Architecture Decision Records (docs/adr/) covering all phases
- Add task tracking system with 283+ task files (docs/stories/)
- Add task generator script for automated task file creation
- Add reference playbooks and requirements documentation

This commit establishes the complete planning foundation for the Go
Platform implementation, documenting all architectural decisions and
providing detailed task breakdown for Phases 0-8.
2025-11-04 22:05:37 +01:00

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

  1. Create pkg/config/config.go
  2. Define ConfigProvider interface:
    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
    }
    
  3. Add package documentation
  4. Export interface for use by modules

Acceptance Criteria

  • pkg/config/config.go exists
  • ConfigProvider interface is defined
  • Interface methods match requirements
  • Package documentation is present
  • Interface compiles without errors

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) bool to check if key exists

Testing

go build ./pkg/config
go vet ./pkg/config