Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
projectdiscovery
GitHub Repository: projectdiscovery/nuclei
Path: blob/dev/pkg/js/libs/smb/memo.smb_private.go
2070 views
1
// Warning - This is generated code
2
package smb
3
4
import (
5
"errors"
6
"fmt"
7
8
"time"
9
10
"github.com/praetorian-inc/fingerprintx/pkg/plugins"
11
12
"github.com/projectdiscovery/nuclei/v3/pkg/protocols/common/protocolstate"
13
)
14
15
func memoizedcollectSMBv2Metadata(executionId string, host string, port int, timeout time.Duration) (*plugins.ServiceSMB, error) {
16
hash := "collectSMBv2Metadata" + ":" + fmt.Sprint(host) + ":" + fmt.Sprint(port) + ":" + fmt.Sprint(timeout)
17
18
v, err, _ := protocolstate.Memoizer.Do(hash, func() (interface{}, error) {
19
return collectSMBv2Metadata(executionId, host, port, timeout)
20
})
21
if err != nil {
22
return nil, err
23
}
24
if value, ok := v.(*plugins.ServiceSMB); ok {
25
return value, nil
26
}
27
28
return nil, errors.New("could not convert cached result")
29
}
30
31