// RunScans iterates over AllScans, running each scan that matches the family
// and scanner regular expressions concurrently.
RunScans iterates over AllScans, running each scan that matches the family
and scanner regular expressions concurrently.
// RunScans iterates over AllScans running each scan that matches the family // and scanner regular expressions concurrently .
func (fs FamilySet) RunScans(host, ip, family, scanner string, timeout time.Duration) (map[string]FamilyResult, error) {
	hostname, port, err := net.SplitHostPort(host)
	if err != nil {
		hostname = host
		port = "443"
	}
	var addr string
	if net.ParseIP(ip) != nil {
		addr = net.JoinHostPort(ip, port)
	} else {
		addr = net.JoinHostPort(hostname, port)
	}
	familyRegexp, err := regexp.Compile(family)
	if err != nil {
		return nil, err
	}
	scannerRegexp, err := regexp.Compile(scanner)
	if err != nil {
		return nil, err
	}
	ctx := newContext(addr, hostname, familyRegexp, scannerRegexp, len(fs))
	for familyName, family := range fs {
		familyCtx := ctx.newfamilyContext(len(family.Scanners))
		for scannerName, scanner := range family.Scanners {
			go familyCtx.runScanner(familyName, scannerName, scanner)
		}
	}
	return ctx.copyResults(timeout), nil
}
func ( fs FamilySet ) RunScans ( host , ip , family , scanner string , timeout time . Duration ) ( map [ string ] FamilyResult , error ) { hostname , port , err := net . SplitHostPort ( host ) if err != nil { hostname = host port = " " } var addr string if net . ParseIP ( ip ) != nil { addr = net . JoinHostPort ( ip , port ) } else { addr = net . JoinHostPort ( hostname , port ) } familyRegexp , err := regexp . Compile ( family ) if err != nil { return nil , err } scannerRegexp , err := regexp . Compile ( scanner ) if err != nil { return nil , err } ctx := newContext ( addr , hostname , familyRegexp , scannerRegexp , len ( fs ) ) for familyName , family := range fs { familyCtx := ctx . newfamilyContext ( len ( family . Scanners ) ) for scannerName , scanner := range family . Scanners { go familyCtx . runScanner ( familyName , scannerName , scanner ) } } return ctx . copyResults ( timeout ) , nil }
RunScans iterates over AllScans, running each scan that matches the family
and scanner regular expressions concurrently.
RunScans iterates over AllScans running each scan that matches the family and scanner regular expressions concurrently .