mirror of
https://github.com/elyby/chrly.git
synced 2024-12-24 14:09:56 +05:30
28 lines
645 B
Go
28 lines
645 B
Go
package di
|
|
|
|
import (
|
|
"github.com/defval/di"
|
|
|
|
. "ely.by/chrly/internal/http"
|
|
"ely.by/chrly/internal/profiles"
|
|
)
|
|
|
|
var profilesDiOptions = 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,
|
|
}
|
|
}
|