mirror of
https://github.com/projectdiscovery/nuclei.git
synced 2025-12-18 13:55:27 +00:00
misc
This commit is contained in:
parent
c16c93fe7c
commit
df78ea72c5
@ -8,6 +8,30 @@ import (
|
|||||||
"github.com/rs/xid"
|
"github.com/rs/xid"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
// Execute takes a list of templates/workflows that have been compiled
|
||||||
|
// and executes them based on provided concurrency options.
|
||||||
|
//
|
||||||
|
// All the execution logic for the templates/workflows happens in this part
|
||||||
|
// of the engine.
|
||||||
|
func (e *Engine) Execute(templates []*templates.Template) {
|
||||||
|
finalTemplates, clusterCount := e.clusterTemplates(templates)
|
||||||
|
|
||||||
|
for _, template := range finalTemplates {
|
||||||
|
templateType := template.Type()
|
||||||
|
|
||||||
|
switch {
|
||||||
|
case template.SelfContained:
|
||||||
|
// Self Contained requests are executed here
|
||||||
|
|
||||||
|
case templateType == "workflow":
|
||||||
|
// Workflows requests are executed here
|
||||||
|
|
||||||
|
default:
|
||||||
|
// All other request types are executed here
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// clusterTemplates performs identical http requests clustering for a list of templates
|
// clusterTemplates performs identical http requests clustering for a list of templates
|
||||||
func (e *Engine) clusterTemplates(templatesList []*templates.Template) ([]*templates.Template, int) {
|
func (e *Engine) clusterTemplates(templatesList []*templates.Template) ([]*templates.Template, int) {
|
||||||
if e.options.OfflineHTTP {
|
if e.options.OfflineHTTP {
|
||||||
|
|||||||
@ -30,8 +30,6 @@ func NewWorkPool(config WorkPoolConfig) *WorkPool {
|
|||||||
return &WorkPool{config: config}
|
return &WorkPool{config: config}
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO: port these invocations of waitgroups and input logic into a generic
|
|
||||||
// workpool type functionality.
|
|
||||||
func (w *WorkPool) Execute(templates []*templates.Template) {
|
func (w *WorkPool) Execute(templates []*templates.Template) {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user