{"modulePath":"github.com/utmstack/nuclei/v3","version":"v3.2.12","isLatest":true,"isStandardLibrary":false,"goos":"linux","goarch":"amd64","docs":"# package code\n\n## Constants\n\n```go\nconst (\n\tTimeoutMultiplier = 6 // timeout multiplier for code protocol\n)\n```\n\n## Variables\n\n```go\nvar (\n\n\t// ErrCodeExecutionDeadline is the error returned when alloted time for script execution exceeds\n\tErrCodeExecutionDeadline = errkit.New(\"code execution deadline exceeded\").SetKind(errkit.ErrKindDeadline).Build()\n)\n```\n\n```go\nvar RequestPartDefinitions = map[string]string{\n\t\"type\":    \"Type is the type of request made\",\n\t\"host\":    \"Host is the input to the template\",\n\t\"matched\": \"Matched is the input which was matched upon\",\n}\n```\nRequestPartDefinitions contains a mapping of request part definitions and their description. Multiple definitions are separated by commas. Definitions not having a name (generated on runtime) are prefixed \u0026 suffixed by \\\u003c\u003e.\n\n## Types\n\n```go\ntype Request struct {\n\t// Operators for the current request go here.\n\toperators.Operators `yaml:\",inline,omitempty\"`\n\tCompiledOperators   *operators.Operators `yaml:\"-\" json:\"-\"`\n\n\t// ID is the optional id of the request\n\tID string `yaml:\"id,omitempty\" json:\"id,omitempty\" jsonschema:\"title=id of the request,description=ID is the optional ID of the Request\"`\n\t// description: |\n\t//   Engine type\n\tEngine []string `yaml:\"engine,omitempty\" json:\"engine,omitempty\" jsonschema:\"title=engine,description=Engine\"`\n\t// description: |\n\t//   PreCondition is a condition which is evaluated before sending the request.\n\tPreCondition string `yaml:\"pre-condition,omitempty\" json:\"pre-condition,omitempty\" jsonschema:\"title=pre-condition for the request,description=PreCondition is a condition which is evaluated before sending the request\"`\n\t// description: |\n\t//   Engine Arguments\n\tArgs []string `yaml:\"args,omitempty\" json:\"args,omitempty\" jsonschema:\"title=args,description=Args\"`\n\t// description: |\n\t//   Pattern preferred for file name\n\tPattern string `yaml:\"pattern,omitempty\" json:\"pattern,omitempty\" jsonschema:\"title=pattern,description=Pattern\"`\n\t// description: |\n\t//   Source File/Snippet\n\tSource string `yaml:\"source,omitempty\" json:\"source,omitempty\" jsonschema:\"title=source file/snippet,description=Source snippet\"`\n\t// contains filtered or unexported fields\n}\n```\nRequest is a request for the SSL protocol\n\n```go\nfunc (request *Request) Compile(options *protocols.ExecutorOptions) error\n```\nCompile compiles the request generators preparing any requests possible.\n\n```go\nfunc (request *Request) ExecuteWithResults(input *contextargs.Context, dynamicValues, previous output.InternalEvent, callback protocols.OutputEventCallback) (err error)\n```\nExecuteWithResults executes the protocol requests and returns results instead of writing them.\n\n```go\nfunc (request *Request) Extract(data map[string]interface{}, matcher *extractors.Extractor) map[string]struct{}\n```\nExtract performs extracting operation for an extractor on model and returns true or false.\n\n```go\nfunc (request *Request) GetCompiledOperators() []*operators.Operators\n```\nGetCompiledOperators returns a list of the compiled operators\n\n```go\nfunc (request *Request) GetID() string\n```\nGetID returns the ID for the request if any.\n\n```go\nfunc (request *Request) MakeResultEvent(wrapped *output.InternalWrappedEvent) []*output.ResultEvent\n```\nMakeResultEvent creates a result event from internal wrapped event\n\n```go\nfunc (request *Request) MakeResultEventItem(wrapped *output.InternalWrappedEvent) *output.ResultEvent\n```\n\n```go\nfunc (request *Request) Match(data map[string]interface{}, matcher *matchers.Matcher) (bool, []string)\n```\nMatch performs matching operation for a matcher on model and returns: true and a list of matched snippets if the matcher type is supports it otherwise false and an empty string slice\n\n```go\nfunc (request *Request) Requests() int\n```\nRequests returns the total number of requests the rule will perform\n\n```go\nfunc (request *Request) Type() templateTypes.ProtocolType\n```\nType returns the type of the protocol request\n\n","path":"github.com/utmstack/nuclei/v3/pkg/protocols/code","name":"code","synopsis":"","isRedistributable":true}
