2022-09-09 18:26:08 +08:00
|
|
|
package application
|
|
|
|
|
|
2023-12-05 23:03:51 +08:00
|
|
|
import (
|
|
|
|
|
"mayfly-go/internal/redis/infrastructure/persistence"
|
2024-01-21 22:52:20 +08:00
|
|
|
"mayfly-go/pkg/ioc"
|
2023-12-05 23:03:51 +08:00
|
|
|
)
|
2022-09-09 18:26:08 +08:00
|
|
|
|
2024-01-22 11:35:28 +08:00
|
|
|
func InitIoc() {
|
2024-01-21 22:52:20 +08:00
|
|
|
persistence.Init()
|
|
|
|
|
|
|
|
|
|
ioc.Register(new(redisAppImpl), ioc.WithComponentName("RedisApp"))
|
|
|
|
|
}
|
2022-09-09 18:26:08 +08:00
|
|
|
|
|
|
|
|
func GetRedisApp() Redis {
|
2024-01-21 22:52:20 +08:00
|
|
|
return ioc.Get[Redis]("RedisApp")
|
2022-09-09 18:26:08 +08:00
|
|
|
}
|