resultconsumer

package
v0.2.7 Latest Latest
Warning

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

Go to latest
Published: Oct 24, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Overview

Package resultconsumer loads durable evidence outside reconciliation workers. Persistence does not authorize SQL or replace the consumer's live epoch checks.

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrPending = errors.New("durable result loading is pending")
	ErrStopped = errors.New("durable result reader is not running")
	ErrBinding = errors.New("durable result does not match the operation claim")
)

Functions

This section is empty.

Types

type Loader

type Loader interface {
	Load(context.Context, Request) (Result, error)
}

type Options

type Options struct {
	Workers, Entries   int
	Timeout, Retention time.Duration
}

type Reader

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

Reader bounds both in-flight loads and retained decoded results. Poll never performs API I/O. Completed entries are consumed once and may be reloaded after a failed status write. Expiration discards only memory, never evidence.

func New

func New(loader Loader, options Options) (*Reader, error)

func (*Reader) NeedLeaderElection

func (*Reader) NeedLeaderElection() bool

func (*Reader) Poll

func (r *Reader) Poll(ctx context.Context, request Request) (Result, error)

func (*Reader) Start

func (r *Reader) Start(ctx context.Context) error

type Request

type Request struct {
	Namespace, Kind, Name                                                 string
	UID                                                                   types.UID
	Generation                                                            int64
	ExecutionBindingID, InputFingerprint, Operation, OperationID, JobName string
	JobUID                                                                types.UID
	Engine                                                                string
}

Request is the persisted claim and engine expected by a consumer. Pod identity is deliberately absent: it comes from the authenticated publication, which remains readable after the producing Pod is removed.

func (Request) Matches

func (r Request) Matches(b resultstore.Binding) bool

type Result

type Result struct {
	Binding resultstore.Binding
	Receipt resultstore.Receipt
	Value   runner.Result
}

type StoreLoader

type StoreLoader struct{ Store resultstore.Store }

func (StoreLoader) Load

func (s StoreLoader) Load(ctx context.Context, request Request) (Result, error)

Jump to

Keyboard shortcuts

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