2022-09-09 18:26:08 +08:00
|
|
|
package persistence
|
|
|
|
|
|
2024-01-21 22:52:20 +08:00
|
|
|
import (
|
|
|
|
|
"mayfly-go/internal/machine/domain/repository"
|
|
|
|
|
"mayfly-go/pkg/ioc"
|
2022-09-09 18:26:08 +08:00
|
|
|
)
|
|
|
|
|
|
2024-01-21 22:52:20 +08:00
|
|
|
func Init() {
|
|
|
|
|
ioc.Register(newMachineRepo(), ioc.WithComponentName("MachineRepo"))
|
|
|
|
|
ioc.Register(newMachineFileRepo(), ioc.WithComponentName("MachineFileRepo"))
|
|
|
|
|
ioc.Register(newMachineScriptRepo(), ioc.WithComponentName("MachineScriptRepo"))
|
|
|
|
|
ioc.Register(newAuthCertRepo(), ioc.WithComponentName("AuthCertRepo"))
|
|
|
|
|
ioc.Register(newMachineCronJobRepo(), ioc.WithComponentName("MachineCronJobRepo"))
|
|
|
|
|
ioc.Register(newMachineCronJobExecRepo(), ioc.WithComponentName("MachineCronJobExecRepo"))
|
|
|
|
|
ioc.Register(newMachineCronJobRelateRepo(), ioc.WithComponentName("MachineCronJobRelateRepo"))
|
|
|
|
|
ioc.Register(newMachineTermOpRepoImpl(), ioc.WithComponentName("MachineTermOpRepo"))
|
|
|
|
|
}
|
|
|
|
|
|
2022-09-09 18:26:08 +08:00
|
|
|
func GetMachineRepo() repository.Machine {
|
2024-01-21 22:52:20 +08:00
|
|
|
return ioc.Get[repository.Machine]("MachineRepo")
|
2022-09-09 18:26:08 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func GetMachineFileRepo() repository.MachineFile {
|
2024-01-21 22:52:20 +08:00
|
|
|
return ioc.Get[repository.MachineFile]("MachineFileRepo")
|
2022-09-09 18:26:08 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func GetMachineScriptRepo() repository.MachineScript {
|
2024-01-21 22:52:20 +08:00
|
|
|
return ioc.Get[repository.MachineScript]("MachineScriptRepo")
|
2022-09-09 18:26:08 +08:00
|
|
|
}
|
2023-03-06 16:59:57 +08:00
|
|
|
|
|
|
|
|
func GetAuthCertRepo() repository.AuthCert {
|
2024-01-21 22:52:20 +08:00
|
|
|
return ioc.Get[repository.AuthCert]("AuthCertRepo")
|
2023-03-06 16:59:57 +08:00
|
|
|
}
|
2023-07-20 22:41:13 +08:00
|
|
|
|
|
|
|
|
func GetMachineCronJobRepo() repository.MachineCronJob {
|
2024-01-21 22:52:20 +08:00
|
|
|
return ioc.Get[repository.MachineCronJob]("MachineCronJobRepo")
|
2023-07-20 22:41:13 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func GetMachineCronJobExecRepo() repository.MachineCronJobExec {
|
2024-01-21 22:52:20 +08:00
|
|
|
return ioc.Get[repository.MachineCronJobExec]("MachineCronJobExecRepo")
|
2023-07-20 22:41:13 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func GetMachineCronJobRelateRepo() repository.MachineCronJobRelate {
|
2024-01-21 22:52:20 +08:00
|
|
|
return ioc.Get[repository.MachineCronJobRelate]("MachineCropJobRelateRepo")
|
2023-07-20 22:41:13 +08:00
|
|
|
}
|
2023-12-05 23:03:51 +08:00
|
|
|
|
|
|
|
|
func GetMachineTermOpRepo() repository.MachineTermOp {
|
2024-01-21 22:52:20 +08:00
|
|
|
return ioc.Get[repository.MachineTermOp]("MachineTermOpRepo")
|
2023-12-05 23:03:51 +08:00
|
|
|
}
|