Skip to content

Commit

Permalink
Merge pull request #5766 from iuliu8899/dev
Browse files Browse the repository at this point in the history
perf(sdk): sdk functions to access workflow store
  • Loading branch information
tarunKoyalwar authored Oct 25, 2024
2 parents 49811d2 + 8a4be44 commit 88b460c
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions lib/sdk.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 88b460c

Please sign in to comment.