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