dontime

package
v0.9.4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 2, 2025 License: MIT Imports: 17 Imported by: 7

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultRequestTimeout = 20 * time.Minute

Functions

This section is empty.

Types

type Factory

type Factory struct {
	services.StateMachine
	// contains filtered or unexported fields
}

func NewFactory

func NewFactory(s *Store, lggr logger.Logger) (*Factory, error)

func (*Factory) Close

func (o *Factory) Close() error

func (*Factory) HealthReport

func (o *Factory) HealthReport() map[string]error

func (*Factory) Name

func (o *Factory) Name() string

func (*Factory) Start

func (o *Factory) Start(ctx context.Context) error

type Plugin

type Plugin struct {
	// contains filtered or unexported fields
}

func NewPlugin

func NewPlugin(store *Store, config ocr3types.ReportingPluginConfig, lggr logger.Logger) (*Plugin, error)

func (*Plugin) Close

func (p *Plugin) Close() error

func (*Plugin) Observation

func (p *Plugin) Observation(_ context.Context, outctx ocr3types.OutcomeContext, query types.Query) (types.Observation, error)

func (*Plugin) ObservationQuorum

func (p *Plugin) ObservationQuorum(_ context.Context, _ ocr3types.OutcomeContext, _ types.Query, aos []types.AttributedObservation) (quorumReached bool, err error)

func (*Plugin) Query

func (*Plugin) Reports

func (p *Plugin) Reports(_ context.Context, _ uint64, outcome ocr3types.Outcome) ([]ocr3types.ReportPlus[[]byte], error)

func (*Plugin) ShouldAcceptAttestedReport

func (p *Plugin) ShouldAcceptAttestedReport(ctx context.Context, seqNr uint64, reportWithInfo ocr3types.ReportWithInfo[[]byte]) (bool, error)

func (*Plugin) ShouldTransmitAcceptedReport

func (p *Plugin) ShouldTransmitAcceptedReport(ctx context.Context, seqNr uint64, reportWithInfo ocr3types.ReportWithInfo[[]byte]) (bool, error)

func (*Plugin) ValidateObservation

type Request

type Request struct {
	ExpiresAt time.Time

	// CallbackCh is a channel to send a response back to the requester
	// after the request has been processed or timed out.
	CallbackCh chan Response

	WorkflowExecutionID string
	SeqNum              int
}

func (*Request) Copy

func (r *Request) Copy() *Request

func (*Request) ExpiryTime

func (r *Request) ExpiryTime() time.Time

func (*Request) ID

func (r *Request) ID() string

func (*Request) SendResponse

func (r *Request) SendResponse(_ context.Context, resp Response)

func (*Request) SendTimeout

func (r *Request) SendTimeout(_ context.Context)

type Response

type Response struct {
	WorkflowExecutionID string
	SeqNum              int
	Timestamp           int64
	Err                 error
}

func (Response) RequestID

func (r Response) RequestID() string

type Store

type Store struct {
	// contains filtered or unexported fields
}

func NewStore

func NewStore(requestTimeout time.Duration) *Store

func (*Store) GetDonTimeForSeqNum

func (s *Store) GetDonTimeForSeqNum(executionID string, seqNum int) *int64

func (*Store) GetDonTimes

func (s *Store) GetDonTimes(executionID string) ([]int64, error)

func (*Store) GetLastObservedDonTime

func (s *Store) GetLastObservedDonTime() int64

func (*Store) GetRequest

func (s *Store) GetRequest(executionID string) *Request

func (*Store) GetRequests added in v0.9.0

func (s *Store) GetRequests() map[string]*Request

func (*Store) RemoveRequest added in v0.9.0

func (s *Store) RemoveRequest(executionID string)

func (*Store) RequestDonTime

func (s *Store) RequestDonTime(executionID string, seqNum int) <-chan Response

RequestDonTime adds a don time request to the queue or return the dontime if we have it yet.

type Transmitter

type Transmitter struct {
	// contains filtered or unexported fields
}

Transmitter is a custom transmitter for the OCR3 capability. When called it will transmit DonTime requests back to the caller and handle deletion of finished executionIDs.

func NewTransmitter

func NewTransmitter(lggr logger.Logger, store *Store, fromAccount types.Account) *Transmitter

func (*Transmitter) FromAccount

func (t *Transmitter) FromAccount(ctx context.Context) (types.Account, error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL