This commit is contained in:
crusader 2018-08-23 19:00:34 +09:00
parent afe0c8e0a9
commit 14cd4345d7
5 changed files with 22 additions and 16 deletions

View File

@ -5,6 +5,9 @@ import (
"net" "net"
"reflect" "reflect"
"go.uber.org/zap"
olog "git.loafle.net/overflow/log-go"
"git.loafle.net/overflow/server-go" "git.loafle.net/overflow/server-go"
ossw "git.loafle.net/overflow/server-go/socket/web" ossw "git.loafle.net/overflow/server-go/socket/web"
) )
@ -51,6 +54,7 @@ func (sh *ServerHandlers) Listener(serverCtx server.ServerCtx) (net.Listener, er
addr := fmt.Sprintf("localhost:%d", i) addr := fmt.Sprintf("localhost:%d", i)
l, err := net.Listen("tcp", addr) l, err := net.Listen("tcp", addr)
if nil == err { if nil == err {
olog.Logger().Debug("Listener", zap.Int("port", i))
// config.ProbePortNumber = int64(i) // config.ProbePortNumber = int64(i)
return l, nil return l, nil
} }

View File

@ -17,10 +17,10 @@ type DiscoveryService struct {
oa.TypeAnnotation `annotation:"@Injectable('name': 'DiscoveryService') @Service()"` oa.TypeAnnotation `annotation:"@Injectable('name': 'DiscoveryService') @Service()"`
} }
func (s *DiscoveryService) StartDiscover() { func (s *DiscoveryService) StartDiscover() error {
return nil
} }
func (s *DiscoveryService) StopDiscover() { func (s *DiscoveryService) StopDiscover() error {
return nil
} }

View File

@ -5,6 +5,8 @@ import (
oa "git.loafle.net/overflow/annotation-go" oa "git.loafle.net/overflow/annotation-go"
od "git.loafle.net/overflow/di-go" od "git.loafle.net/overflow/di-go"
omn "git.loafle.net/overflow/model/net"
"git.loafle.net/overflow_scanner/probe/nic"
) )
func init() { func init() {
@ -17,6 +19,6 @@ type MachineService struct {
oa.TypeAnnotation `annotation:"@Injectable('name': 'MachineService') @Service()"` oa.TypeAnnotation `annotation:"@Injectable('name': 'MachineService') @Service()"`
} }
func (s *MachineService) Interfaces() { func (s *MachineService) Interfaces() ([]*omn.Interface, error) {
return nic.DiscoverInterfaces()
} }

View File

@ -17,14 +17,14 @@ type PingService struct {
oa.TypeAnnotation `annotation:"@Injectable('name': 'PingService') @Service()"` oa.TypeAnnotation `annotation:"@Injectable('name': 'PingService') @Service()"`
} }
func (s *PingService) PingHost() { func (s *PingService) PingHost() error {
return nil
} }
func (s *PingService) PingService() { func (s *PingService) PingService() error {
return nil
} }
func (s *PingService) PingAll() { func (s *PingService) PingAll() error {
return nil
} }

View File

@ -17,10 +17,10 @@ type SNMPService struct {
oa.TypeAnnotation `annotation:"@Injectable('name': 'SNMPService') @Service()"` oa.TypeAnnotation `annotation:"@Injectable('name': 'SNMPService') @Service()"`
} }
func (s *SNMPService) ScanSNMP() { func (s *SNMPService) ScanSNMP() error {
return nil
} }
func (s *SNMPService) PingSNMP() { func (s *SNMPService) PingSNMP() error {
return nil
} }