2024-01-30 13:35:04 +05:30
|
|
|
package di
|
|
|
|
|
|
|
|
import (
|
|
|
|
"github.com/defval/di"
|
|
|
|
|
2024-02-01 12:42:34 +05:30
|
|
|
. "ely.by/chrly/internal/http"
|
|
|
|
"ely.by/chrly/internal/profiles"
|
2024-01-30 13:35:04 +05:30
|
|
|
)
|
|
|
|
|
|
|
|
var profilesDi = di.Options(
|
|
|
|
di.Provide(newProfilesManager, di.As(new(ProfilesManager))),
|
|
|
|
di.Provide(newProfilesProvider, di.As(new(ProfilesProvider))),
|
|
|
|
)
|
|
|
|
|
|
|
|
func newProfilesManager(r profiles.ProfilesRepository) *profiles.Manager {
|
|
|
|
return profiles.NewManager(r)
|
|
|
|
}
|
|
|
|
|
|
|
|
func newProfilesProvider(
|
|
|
|
finder profiles.ProfilesFinder,
|
|
|
|
mojangProfilesProvider profiles.MojangProfilesProvider,
|
|
|
|
) *profiles.Provider {
|
|
|
|
return &profiles.Provider{
|
|
|
|
ProfilesFinder: finder,
|
|
|
|
MojangProfilesProvider: mojangProfilesProvider,
|
|
|
|
}
|
|
|
|
}
|