Files
mayfly-go/server/internal/machine/application/application.go

35 lines
1022 B
Go
Raw Normal View History

2022-09-09 18:26:08 +08:00
package application
import (
2024-01-21 22:52:20 +08:00
"mayfly-go/pkg/ioc"
)
2022-09-09 18:26:08 +08:00
func InitIoc() {
2024-01-21 22:52:20 +08:00
ioc.Register(new(machineAppImpl), ioc.WithComponentName("MachineApp"))
ioc.Register(new(machineFileAppImpl), ioc.WithComponentName("MachineFileApp"))
ioc.Register(new(machineScriptAppImpl), ioc.WithComponentName("MachineScriptApp"))
ioc.Register(new(machineCronJobAppImpl), ioc.WithComponentName("MachineCronJobApp"))
ioc.Register(new(machineTermOpAppImpl), ioc.WithComponentName("MachineTermOpApp"))
ioc.Register(new(machineCmdConfAppImpl), ioc.WithComponentName("MachineCmdConfApp"))
2024-01-21 22:52:20 +08:00
}
2022-09-09 18:26:08 +08:00
func GetMachineApp() Machine {
2024-01-21 22:52:20 +08:00
return ioc.Get[Machine]("MachineApp")
2022-09-09 18:26:08 +08:00
}
func GetMachineFileApp() MachineFile {
2024-01-21 22:52:20 +08:00
return ioc.Get[MachineFile]("MachineFileApp")
2022-09-09 18:26:08 +08:00
}
func GetMachineScriptApp() MachineScript {
2024-01-21 22:52:20 +08:00
return ioc.Get[MachineScript]("MachineScriptApp")
2022-09-09 18:26:08 +08:00
}
func GetMachineCronJobApp() MachineCronJob {
2024-01-21 22:52:20 +08:00
return ioc.Get[MachineCronJob]("MachineCronJobApp")
}
func GetMachineTermOpApp() MachineTermOp {
2024-01-21 22:52:20 +08:00
return ioc.Get[MachineTermOp]("MachineTermOpApp")
}