add sdk option to disable update check (#5346)

This commit is contained in:
Dogan Can Bakir 2024-07-15 16:21:16 +03:00 committed by GitHub
parent 6cbd73f780
commit 6c32eb7d1e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 14 additions and 2 deletions

View File

@ -1,9 +1,13 @@
package main
import nuclei "github.com/projectdiscovery/nuclei/v3/lib"
import (
"context"
nuclei "github.com/projectdiscovery/nuclei/v3/lib"
)
func main() {
ne, err := nuclei.NewNucleiEngine(
ne, err := nuclei.NewNucleiEngineCtx(context.Background(),
nuclei.WithTemplateFilters(nuclei.TemplateFilters{Tags: []string{"oast"}}),
nuclei.EnableStatsWithOpts(nuclei.StatsOptions{MetricServerPort: 6064}), // optionally enable metrics server for better observability
)

View File

@ -440,3 +440,11 @@ func WithCatalog(cat catalog.Catalog) NucleiSDKOptions {
return nil
}
}
// DisableUpdateCheck disables nuclei update check
func DisableUpdateCheck() NucleiSDKOptions {
return func(e *NucleiEngine) error {
DefaultConfig.DisableUpdateCheck()
return nil
}
}