{"modulePath":"github.com/GoPlugin/pluginV2","version":"v0.5.0","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package directrequestocr\n\n## Constants\n\n```go\nconst (\n\tCBORParseTaskName   string = \"decode_cbor\"\n\tParseResultTaskName string = \"parse_result\"\n\tParseErrorTaskName  string = \"parse_error\"\n)\n```\n\n```go\nconst RequestIDLength int = 32\n```\n\n## Functions\n\n```go\nfunc CheckStateTransition(prev RequestState, next RequestState) error\n```\n\\*       +-----------+ \\*  +----+IN\\_PROGRESS+----------------+ \\*  |    +-----+-----+                | \\*  |          |                      | \\*  |          v                      v \\*  |   +------------+           +---------+ \\*  |   |RESULT\\_READY+----------\u003e|TIMED\\_OUT| \\*  |   +------+-----+           +---------+ \\*  |          |                      ^ \\*  |          v                      | \\*  |     +---------+                 | \\*  +----\u003e|FINALIZED|-----------------+ \\*        +---------+ \\* \\*                     \\\\   / \\*                       | \\*                       v \\*                  +---------+ \\*                  |CONFIRMED| \\*                  +---------+\n\n```go\nfunc ExtractRawBytes(input []byte) ([]byte, error)\n```\nProcess result from the EA saved by a jsonparse pipeline task. That value is a valid JSON string so it contains double quote characters. Allowed inputs are:\n\n 1. \"\" (2 characters) -\u003e return empty byte array\n 2. \"0x\\\u003cval\u003e\" where \\\u003cval\u003e is a non-empty, valid hex -\u003e return hex-decoded \\\u003cval\u003e\n\n## Types\n\n```go\ntype DRListener struct {\n\tutils.StartStopOnce\n\t// contains filtered or unexported fields\n}\n```\n\n```go\nfunc NewDRListener(oracle *ocr2dr_oracle.OCR2DROracle, jb job.Job, runner pipeline.Runner, jobORM job.ORM, pluginORM ORM, pluginConfig config.PluginConfig, logBroadcaster log.Broadcaster, lggr logger.Logger, mailMon *utils.MailboxMonitor) *DRListener\n```\n\n```go\nfunc (l *DRListener) Close() error\n```\nClose complies with job.Service\n\n```go\nfunc (l *DRListener) HandleLog(lb log.Broadcast)\n```\nHandleLog implements log.Listener\n\n```go\nfunc (l *DRListener) JobID() int32\n```\nJobID() complies with log.Listener\n\n```go\nfunc (l *DRListener) Start(context.Context) error\n```\nStart complies with job.Service\n\n```go\ntype ErrType int8\n```\n\n```go\nconst (\n\tNONE ErrType = iota\n\t// caused by internal infra problems, potentially retryable\n\tINTERNAL_ERROR\n\t// caused by user's code (exception, crash, timeout, ...)\n\tUSER_ERROR\n)\n```\n\n```go\nfunc (e ErrType) String() string\n```\n\n```go\ntype ORM interface {\n\tCreateRequest(requestID RequestID, receivedAt time.Time, requestTxHash *common.Hash, qopts ...pg.QOpt) error\n\n\tSetResult(requestID RequestID, runID int64, computationResult []byte, readyAt time.Time, qopts ...pg.QOpt) error\n\tSetError(requestID RequestID, runID int64, errorType ErrType, computationError []byte, readyAt time.Time, readyForProcessing bool, qopts ...pg.QOpt) error\n\tSetFinalized(requestID RequestID, reportedResult []byte, reportedError []byte, qopts ...pg.QOpt) error\n\tSetConfirmed(requestID RequestID, qopts ...pg.QOpt) error\n\n\tTimeoutExpiredResults(cutoff time.Time, limit uint32, qopts ...pg.QOpt) ([]RequestID, error)\n\n\tFindOldestEntriesByState(state RequestState, limit uint32, qopts ...pg.QOpt) ([]Request, error)\n\tFindById(requestID RequestID, qopts ...pg.QOpt) (*Request, error)\n}\n```\n\n```go\nfunc NewORM(db *sqlx.DB, lggr logger.Logger, cfg pg.QConfig, contractAddress common.Address) ORM\n```\n\n```go\ntype Request struct {\n\tRequestID         RequestID\n\tRunID             *int64\n\tReceivedAt        time.Time\n\tRequestTxHash     *common.Hash\n\tState             RequestState\n\tResultReadyAt     *time.Time\n\tResult            []byte\n\tErrorType         *ErrType\n\tError             []byte\n\tTransmittedResult []byte\n\tTransmittedError  []byte\n}\n```\n\n```go\ntype RequestID [RequestIDLength]byte\n```\n\n```go\nfunc (r *RequestID) Scan(value interface{}) error\n```\n\n```go\nfunc (r RequestID) String() string\n```\n\n```go\nfunc (r RequestID) Value() (driver.Value, error)\n```\n\n```go\ntype RequestState int8\n```\n\n```go\nconst (\n\t// IN_PROGRESS is the initial state of a request, set right after receiving it in an on-chain event.\n\tIN_PROGRESS RequestState = iota\n\n\t// RESULT_READY means that computation has finished executing (with either success or user error).\n\t// OCR2 reporting includes only requests in RESULT_READY state (for Query and Observation phases).\n\tRESULT_READY\n\n\t// TIMED_OUT request has been waiting to get confirmed on chain for too long.\n\t// It won't be included in OCR2 reporting rounds any more.\n\tTIMED_OUT\n\n\t// FINALIZED request is a part of a report produced by OCR2 and has now entered the transmission protocol\n\t// (i.e. passed through ShouldAcceptFinalizedReport()).\n\tFINALIZED\n\n\t// CONFIRMED state indicates that we received an on-chain confirmation event\n\t// (with or without this node's participation in an earlier OCR round).\n\t// We can transition here at any time (full fan-in) and cannot transition out (empty fan-out).\n\t// This is a desired and expected final state for every request.\n\tCONFIRMED\n)\n```\n\n```go\nfunc (s RequestState) String() string\n```\n\n","path":"github.com/GoPlugin/pluginV2/core/services/directrequestocr","name":"directrequestocr","synopsis":"","isRedistributable":true}
