♻️ Refactor config
Make it easier to setup stores
This commit is contained in:
parent
ecae0d5f83
commit
6f06adc37d
12 changed files with 623 additions and 81 deletions
17
config/interface.go
Normal file
17
config/interface.go
Normal 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)
|
||||
}
|
||||
Reference in a new issue