package discoverer import ( "fmt" ocmd "git.loafle.net/overflow/commons-go/model/discovery" ocmm "git.loafle.net/overflow/commons-go/model/meta" "git.loafle.net/overflow/container_discovery/internal/discoverer/ipv4" "git.loafle.net/overflow/container_discovery/internal/discoverer/ipv6" ) func scanHost(zone *ocmd.Zone, dh *ocmd.DiscoverHost, resultChan chan interface{}, errChan chan error, doneChan chan<- struct{}, stopChan chan struct{}) { defer func() { doneChan <- struct{}{} }() switch ocmm.ToMetaIPTypeEnum(dh.MetaIPType) { case ocmm.MetaIPTypeEnumV4: ipv4.ScanHost(zone, dh, resultChan, errChan, stopChan) case ocmm.MetaIPTypeEnumV6: ipv6.ScanHost(zone, dh, resultChan, errChan, stopChan) default: errChan <- fmt.Errorf("Discovery: Not supported MetaIPType") } }