mirror of
https://github.com/projectdiscovery/nuclei.git
synced 2025-12-17 16:05:26 +00:00
perf(sdk): sdk functions to access workflow store
This commit is contained in:
parent
49811d24a1
commit
8a4be44631
13
lib/sdk.go
13
lib/sdk.go
@ -112,6 +112,14 @@ func (e *NucleiEngine) GetTemplates() []*templates.Template {
|
||||
return e.store.Templates()
|
||||
}
|
||||
|
||||
// GetWorkflows returns all nuclei workflows that are loaded
|
||||
func (e *NucleiEngine) GetWorkflows() []*templates.Template {
|
||||
if !e.templatesLoaded {
|
||||
_ = e.LoadAllTemplates()
|
||||
}
|
||||
return e.store.Workflows()
|
||||
}
|
||||
|
||||
// LoadTargets(urls/domains/ips only) adds targets to the nuclei engine
|
||||
func (e *NucleiEngine) LoadTargets(targets []string, probeNonHttp bool) {
|
||||
for _, target := range targets {
|
||||
@ -271,6 +279,11 @@ func (e *NucleiEngine) Engine() *core.Engine {
|
||||
return e.engine
|
||||
}
|
||||
|
||||
// Store returns store of nuclei
|
||||
func (e *NucleiEngine) Store() *loader.Store {
|
||||
return e.store
|
||||
}
|
||||
|
||||
// NewNucleiEngineCtx creates a new nuclei engine instance with given context
|
||||
func NewNucleiEngineCtx(ctx context.Context, options ...NucleiSDKOptions) (*NucleiEngine, error) {
|
||||
// default options
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user