♻️ Refactor config

Make it easier to setup stores
This commit is contained in:
Dan Jones 2025-01-26 20:07:45 -06:00
commit 6f06adc37d
12 changed files with 623 additions and 81 deletions

17
config/interface.go Normal file
View file

@ -0,0 +1,17 @@
package config
//go:generate mockgen -source interface.go -destination ../internal/testmocks/config/config_mock.go -package config -typed
type Config interface {
Name() string
Env() Env
BaseURL() string
StoreName() string
Store(name string) (Store, error)
}
type Store interface {
Name() string
Decode(v any) error
Map() (map[string]any, error)
}