diff --git a/crawler/health/SocketHeahthCrawler.go b/crawler/health/SocketHeahthCrawler.go index 12562fb..3b380ce 100644 --- a/crawler/health/SocketHeahthCrawler.go +++ b/crawler/health/SocketHeahthCrawler.go @@ -8,6 +8,7 @@ import ( cnsm "git.loafle.net/commons/service_matcher-go" cuej "git.loafle.net/commons/util-go/encoding/json" + ocmm "git.loafle.net/overflow/commons-go/model/meta" ocmsc "git.loafle.net/overflow/commons-go/model/sensorconfig" "git.loafle.net/overflow/crawler-go" ) @@ -33,16 +34,16 @@ func (s *SocketHealthCrawler) getConnection(config *ocmsc.SensorConfig) (net.Con network := "" switch metaIPTypeKey { - case "V6": + case ocmm.MetaIPTypeEnumV4.String(): switch metaPortTypeKey { - case "UDP": + case ocmm.MetaPortTypeEnumUDP.String(): network = "udp6" default: network = "tcp6" } default: switch metaPortTypeKey { - case "UDP": + case ocmm.MetaPortTypeEnumUDP.String(): network = "udp" default: network = "tcp" @@ -54,7 +55,7 @@ func (s *SocketHealthCrawler) getConnection(config *ocmsc.SensorConfig) (net.Con return nil, err } - if metaCryptoTypeKey == "TLS" { + if metaCryptoTypeKey == ocmm.MetaCryptoTypeEnumTLS.String() { cfg := &tls.Config{ InsecureSkipVerify: true, ServerName: ip,