mirror of
https://github.com/projectdiscovery/nuclei.git
synced 2025-12-26 17:05:28 +00:00
* Adding support to scan all v4/v6 IPs * adding tests * metainput prototype * using new signature * fixing nil pointer * adding request context with metadata * removing log instruction * fixing merge conflicts * adding clone helpers * attempting to fix ipv6 square parenthesis wrap * fixing dialed ip info * fixing syntax * fixing output ip selection * adding integration tests * disabling test due to gh ipv6 issue * using ipv4 only due to GH limited networking * extending metainput marshaling * fixing hmap key * adding test for httpx integration * fixing lint error * reworking marshaling/id-calculation * adding ip version validation * improving handling non url targets * fixing condition check
22 lines
528 B
Go
22 lines
528 B
Go
package inputs
|
|
|
|
import "github.com/projectdiscovery/nuclei/v2/pkg/protocols/common/contextargs"
|
|
|
|
type SimpleInputProvider struct {
|
|
Inputs []*contextargs.MetaInput
|
|
}
|
|
|
|
// Count returns the number of items for input provider
|
|
func (s *SimpleInputProvider) Count() int64 {
|
|
return int64(len(s.Inputs))
|
|
}
|
|
|
|
// Scan calls a callback function till the input provider is exhausted
|
|
func (s *SimpleInputProvider) Scan(callback func(value *contextargs.MetaInput) bool) {
|
|
for _, v := range s.Inputs {
|
|
if !callback(v) {
|
|
return
|
|
}
|
|
}
|
|
}
|