From e57de1cf1d576ac32e1f4ed0160304aeae4361f4 Mon Sep 17 00:00:00 2001 From: forgedhallpass <13679401+forgedhallpass@users.noreply.github.com> Date: Fri, 4 Nov 2022 14:36:44 +0200 Subject: [PATCH] documentation: update readme with using subfinder as a library #691 --- README.md | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) diff --git a/README.md b/README.md index 04263bda5..4060a72de 100644 --- a/README.md +++ b/README.md @@ -236,30 +236,24 @@ package main import ( "bytes" - "context" "fmt" "io" "log" - "github.com/projectdiscovery/subfinder/v2/pkg/passive" "github.com/projectdiscovery/subfinder/v2/pkg/resolve" "github.com/projectdiscovery/subfinder/v2/pkg/runner" ) func main() { runnerInstance, err := runner.NewRunner(&runner.Options{ - Threads: 10, // Thread controls the number of threads to use for active enumerations - Timeout: 30, // Timeout is the seconds to wait for sources to respond - MaxEnumerationTime: 10, // MaxEnumerationTime is the maximum amount of time in mins to wait for enumeration + Threads: 10, // Thread controls the number of threads to use for active enumerations + Timeout: 30, // Timeout is the seconds to wait for sources to respond + MaxEnumerationTime: 10, // MaxEnumerationTime is the maximum amount of time in mins to wait for enumeration Resolvers: resolve.DefaultResolvers, // Use the default list of resolvers by marshaling it to the config - Sources: passive.DefaultSources, // Use the default list of passive sources - AllSources: passive.DefaultAllSources, // Use the default list of all passive sources - Recursive: passive.DefaultRecursiveSources, // Use the default list of recursive sources - Providers: &runner.Providers{}, // Use empty api keys for all providers - }) + }) buf := bytes.Buffer{} - err = runnerInstance.EnumerateSingleDomain(context.Background(), "projectdiscovery.io", []io.Writer{&buf}) + err = runnerInstance.EnumerateSingleDomain("projectdiscovery.io", []io.Writer{&buf}) if err != nil { log.Fatal(err) }