probe/service/MachineService.go

41 lines
843 B
Go
Raw Normal View History

2018-08-23 09:21:48 +00:00
package service
import (
2018-09-13 16:14:34 +00:00
"log"
2018-08-23 09:21:48 +00:00
"reflect"
oa "git.loafle.net/overflow/annotation-go"
od "git.loafle.net/overflow/di-go"
2018-08-23 10:00:34 +00:00
omn "git.loafle.net/overflow/model/net"
"git.loafle.net/overflow_scanner/probe/nic"
2018-08-23 09:21:48 +00:00
)
func init() {
od.RegisterType(MachineServiceType)
}
var MachineServiceType = reflect.TypeOf((*MachineService)(nil))
type MachineService struct {
oa.TypeAnnotation `annotation:"@Injectable('name': 'MachineService') @Service()"`
2018-09-04 07:07:45 +00:00
_InitService oa.MethodAnnotation `annotation:"@PostConstruct()"`
_DestroyService oa.MethodAnnotation `annotation:"@PreDestroy()"`
}
func (s *MachineService) InitService() {
}
func (s *MachineService) DestroyService() {
2018-08-23 09:21:48 +00:00
}
2018-08-23 10:00:34 +00:00
func (s *MachineService) Interfaces() ([]*omn.Interface, error) {
2018-09-13 16:14:34 +00:00
ifaces, err := nic.DiscoverInterfaces()
if nil != err {
log.Print(err)
}
return ifaces, err
2018-08-23 09:21:48 +00:00
}