MCPcopy
hub / github.com/OJ/gobuster / New

Function New

gobusterdns/gobusterdns.go:48–72  ·  view source on GitHub ↗

New creates a new initialized GobusterDNS

(globalopts *libgobuster.Options, opts *OptionsDNS)

Source from the content-addressed store, hash-verified

46
47// New creates a new initialized GobusterDNS
48func New(globalopts *libgobuster.Options, opts *OptionsDNS) (*GobusterDNS, error) {
49 if globalopts == nil {
50 return nil, errors.New("please provide valid global options")
51 }
52
53 if opts == nil {
54 return nil, errors.New("please provide valid plugin options")
55 }
56
57 resolver := net.DefaultResolver
58 if opts.Resolver != "" {
59 resolver = &net.Resolver{
60 PreferGo: true,
61 Dial: newCustomDialer(opts.Resolver, opts.Protocol),
62 }
63 }
64
65 g := GobusterDNS{
66 options: opts,
67 globalopts: globalopts,
68 wildcardIps: libgobuster.NewSet[netip.Addr](),
69 resolver: resolver,
70 }
71 return &g, nil
72}
73
74// Name should return the name of the plugin
75func (d *GobusterDNS) Name() string {

Callers 1

runFunction · 0.92

Calls 2

NewSetFunction · 0.92
newCustomDialerFunction · 0.85

Tested by

no test coverage detected