add default provider

This commit is contained in:
yanghao05
2023-05-06 11:26:21 +08:00
parent 5362691ad5
commit 3a9a1a6eeb
12 changed files with 124 additions and 0 deletions

View File

@@ -29,6 +29,10 @@ type ProviderContainer struct {
type Providers []ProviderContainer
func (p Providers) With(pcs Providers) Providers {
return append(p, pcs...)
}
func (p Providers) Provide(config *viper.Viper) error {
for _, provider := range p {
provider.Options = append(provider.Options, opt.Config(config))