32 lines
635 B
Go
Executable File
32 lines
635 B
Go
Executable File
package workers
|
|
|
|
import (
|
|
"backend/modules/commands/store"
|
|
"backend/providers/storage"
|
|
|
|
"git.ipao.vip/rogeecn/atom"
|
|
"git.ipao.vip/rogeecn/atom/container"
|
|
"git.ipao.vip/rogeecn/atom/contracts"
|
|
"git.ipao.vip/rogeecn/atom/utils/opt"
|
|
)
|
|
|
|
func Provide(opts ...opt.Option) error {
|
|
if err := container.Container.Provide(func(
|
|
cmdStore *store.StoreMedias,
|
|
storage *storage.Config,
|
|
) (contracts.Initial, error) {
|
|
obj := &Controller{
|
|
cmdStore: cmdStore,
|
|
storage: storage,
|
|
}
|
|
if err := obj.Prepare(); err != nil {
|
|
return nil, err
|
|
}
|
|
return obj, nil
|
|
}, atom.GroupInitial); err != nil {
|
|
return err
|
|
}
|
|
|
|
return nil
|
|
}
|