feat: add providers

This commit is contained in:
Rogee
2024-12-15 10:18:12 +08:00
parent 35e509c0d7
commit bfbb081a95
5 changed files with 299 additions and 0 deletions

View File

@@ -0,0 +1,19 @@
package storage
import (
"git.ipao.vip/rogeecn/atom/container"
"git.ipao.vip/rogeecn/atom/utils/opt"
)
func Provide(opts ...opt.Option) error {
o := opt.New(opts...)
var config Config
if err := o.UnmarshalConfig(&config); err != nil {
return err
}
return container.Container.Provide(func() (*Config, error) {
config.tmpStore = make(map[string]string)
return &config, nil
}, o.DiOptions()...)
}