Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
projectdiscovery
GitHub Repository: projectdiscovery/nuclei
Path: blob/dev/pkg/js/libs/rdp/memo.rdp.go
2070 views
1
// Warning - This is generated code
2
package rdp
3
4
import (
5
"errors"
6
"fmt"
7
8
"github.com/projectdiscovery/nuclei/v3/pkg/protocols/common/protocolstate"
9
)
10
11
func memoizedisRDP(executionId string, host string, port int) (IsRDPResponse, error) {
12
hash := "isRDP" + ":" + fmt.Sprint(host) + ":" + fmt.Sprint(port)
13
14
v, err, _ := protocolstate.Memoizer.Do(hash, func() (interface{}, error) {
15
return isRDP(executionId, host, port)
16
})
17
if err != nil {
18
return IsRDPResponse{}, err
19
}
20
if value, ok := v.(IsRDPResponse); ok {
21
return value, nil
22
}
23
24
return IsRDPResponse{}, errors.New("could not convert cached result")
25
}
26
27
func memoizedcheckRDPAuth(executionId string, host string, port int) (CheckRDPAuthResponse, error) {
28
hash := "checkRDPAuth" + ":" + fmt.Sprint(host) + ":" + fmt.Sprint(port)
29
30
v, err, _ := protocolstate.Memoizer.Do(hash, func() (interface{}, error) {
31
return checkRDPAuth(executionId, host, port)
32
})
33
if err != nil {
34
return CheckRDPAuthResponse{}, err
35
}
36
if value, ok := v.(CheckRDPAuthResponse); ok {
37
return value, nil
38
}
39
40
return CheckRDPAuthResponse{}, errors.New("could not convert cached result")
41
}
42
43