mirror of
https://github.com/projectdiscovery/nuclei.git
synced 2025-12-18 13:45:28 +00:00
26 lines
585 B
Go
26 lines
585 B
Go
|
|
// Warning - This is generated code
|
||
|
|
package vnc
|
||
|
|
|
||
|
|
import (
|
||
|
|
"errors"
|
||
|
|
"fmt"
|
||
|
|
|
||
|
|
"github.com/projectdiscovery/nuclei/v3/pkg/protocols/common/protocolstate"
|
||
|
|
)
|
||
|
|
|
||
|
|
func memoizedisVNC(host string, port int) (IsVNCResponse, error) {
|
||
|
|
hash := "isVNC" + ":" + fmt.Sprint(host) + ":" + fmt.Sprint(port)
|
||
|
|
|
||
|
|
v, err, _ := protocolstate.Memoizer.Do(hash, func() (interface{}, error) {
|
||
|
|
return isVNC(host, port)
|
||
|
|
})
|
||
|
|
if err != nil {
|
||
|
|
return IsVNCResponse{}, err
|
||
|
|
}
|
||
|
|
if value, ok := v.(IsVNCResponse); ok {
|
||
|
|
return value, nil
|
||
|
|
}
|
||
|
|
|
||
|
|
return IsVNCResponse{}, errors.New("could not convert cached result")
|
||
|
|
}
|