2024-03-01 16:10:18 +03:00
|
|
|
// Warning - This is generated code
|
|
|
|
|
package mysql
|
|
|
|
|
|
|
|
|
|
import (
|
|
|
|
|
"errors"
|
|
|
|
|
"fmt"
|
|
|
|
|
|
|
|
|
|
"github.com/projectdiscovery/nuclei/v3/pkg/protocols/common/protocolstate"
|
|
|
|
|
)
|
|
|
|
|
|
2025-07-09 14:47:26 -05:00
|
|
|
func memoizedisMySQL(executionId string, host string, port int) (bool, error) {
|
2024-03-01 16:10:18 +03:00
|
|
|
hash := "isMySQL" + ":" + fmt.Sprint(host) + ":" + fmt.Sprint(port)
|
|
|
|
|
|
|
|
|
|
v, err, _ := protocolstate.Memoizer.Do(hash, func() (interface{}, error) {
|
2025-07-09 14:47:26 -05:00
|
|
|
return isMySQL(executionId, host, port)
|
2024-03-01 16:10:18 +03:00
|
|
|
})
|
|
|
|
|
if err != nil {
|
|
|
|
|
return false, err
|
|
|
|
|
}
|
|
|
|
|
if value, ok := v.(bool); ok {
|
|
|
|
|
return value, nil
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return false, errors.New("could not convert cached result")
|
|
|
|
|
}
|
|
|
|
|
|
2025-07-09 14:47:26 -05:00
|
|
|
func memoizedfingerprintMySQL(executionId string, host string, port int) (MySQLInfo, error) {
|
2024-03-01 16:10:18 +03:00
|
|
|
hash := "fingerprintMySQL" + ":" + fmt.Sprint(host) + ":" + fmt.Sprint(port)
|
|
|
|
|
|
|
|
|
|
v, err, _ := protocolstate.Memoizer.Do(hash, func() (interface{}, error) {
|
2025-07-09 14:47:26 -05:00
|
|
|
return fingerprintMySQL(executionId, host, port)
|
2024-03-01 16:10:18 +03:00
|
|
|
})
|
|
|
|
|
if err != nil {
|
|
|
|
|
return MySQLInfo{}, err
|
|
|
|
|
}
|
|
|
|
|
if value, ok := v.(MySQLInfo); ok {
|
|
|
|
|
return value, nil
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return MySQLInfo{}, errors.New("could not convert cached result")
|
|
|
|
|
}
|