35 lines
1.1 KiB
Go
35 lines
1.1 KiB
Go
package scaninfo
|
|
|
|
import "git.loafle.net/overflow/overflow_probe/discovery/discovery/types"
|
|
|
|
type ServiceScanInfo interface {
|
|
SetHistory(history *types.ServiceScanHistory)
|
|
GetHistories() []*types.ServiceScanHistory
|
|
GetPort() string
|
|
GetIP() string
|
|
GetDiscoveryPort() *types.DiscoveryPort
|
|
}
|
|
|
|
type ScanInfoImpl struct {
|
|
//Ip string
|
|
//Port string
|
|
//histories []string
|
|
histories []*types.ServiceScanHistory
|
|
discoveryPort *types.DiscoveryPort
|
|
}
|
|
|
|
func (s *ScanInfoImpl) SetHistory(history *types.ServiceScanHistory) {
|
|
//s.histories = append(s.histories, history)
|
|
s.histories = append(s.histories, history)
|
|
}
|
|
func (s *ScanInfoImpl) GetPort() string { return s.discoveryPort.Port_ }
|
|
func (s *ScanInfoImpl) GetIP() string { return s.discoveryPort.Host.Ip_ }
|
|
func (s *ScanInfoImpl) GetDiscoveryPort() *types.DiscoveryPort { return s.discoveryPort }
|
|
func (s *ScanInfoImpl) GetHistories() []*types.ServiceScanHistory { return s.histories }
|
|
|
|
|
|
|
|
func NewScanInfoImpl(discoveryPort *types.DiscoveryPort) *ScanInfoImpl {
|
|
return &ScanInfoImpl{discoveryPort:discoveryPort}
|
|
}
|