to options mode

This commit is contained in:
yanghao05
2023-04-27 18:30:39 +08:00
parent 8ae3d19aa9
commit 574736a878
20 changed files with 180 additions and 50 deletions

View File

@@ -4,16 +4,16 @@ import (
"time"
"github.com/rogeecn/atom/container"
"go.uber.org/dig"
"github.com/rogeecn/atom/providers"
"github.com/brianvoe/gofakeit/v6"
)
func Provide(opts ...dig.ProvideOption) error {
func Provide(o *providers.Options) error {
return container.Container.Provide(func() (*gofakeit.Faker, error) {
faker := gofakeit.New(time.Now().UnixNano())
gofakeit.SetGlobalFaker(faker)
return faker, nil
}, opts...)
}, o.DiOptions()...)
}