mirror of
https://github.com/projectdiscovery/nuclei.git
synced 2025-12-18 12:25:28 +00:00
* initial implementation with manual code generation * testing generation * refactor to package methods + auto memoize * more memos * fixing signatures * refactor * adding gen util * adding util * regenerate memoized files --------- Co-authored-by: Tarun Koyalwar <tarun@projectdiscovery.io>
26 lines
601 B
Go
Executable File
26 lines
601 B
Go
Executable File
// Warning - This is generated code
|
|
package rsync
|
|
|
|
import (
|
|
"errors"
|
|
"fmt"
|
|
|
|
"github.com/projectdiscovery/nuclei/v3/pkg/protocols/common/protocolstate"
|
|
)
|
|
|
|
func memoizedisRsync(host string, port int) (IsRsyncResponse, error) {
|
|
hash := "isRsync" + ":" + fmt.Sprint(host) + ":" + fmt.Sprint(port)
|
|
|
|
v, err, _ := protocolstate.Memoizer.Do(hash, func() (interface{}, error) {
|
|
return isRsync(host, port)
|
|
})
|
|
if err != nil {
|
|
return IsRsyncResponse{}, err
|
|
}
|
|
if value, ok := v.(IsRsyncResponse); ok {
|
|
return value, nil
|
|
}
|
|
|
|
return IsRsyncResponse{}, errors.New("could not convert cached result")
|
|
}
|