Documentation
¶
Overview ¶
Package httpstore provides the event adapter for HTTP resource fetching.
This package wraps the pure httpstore component (pkg/httpstore) with event coordination. It manages refresh timers and publishes events when content changes, allowing the reconciliation pipeline to validate new content before accepting it.
Index ¶
- Constants
- Variables
- func CandidatesWithheld(ctx context.Context) bool
- func ParseFetchArgs(args []any) (string, httpstore.FetchOptions, *httpstore.AuthConfig, error)
- func WithCandidatesWithheld(ctx context.Context) context.Context
- type Component
- func (c *Component) AcceptanceSequence() uint64
- func (c *Component) AcceptedSnapshot(url string, descriptor httpstore.SourceDescriptor) (httpstore.ContentSnapshot, bool)
- func (c *Component) AdvanceAcceptedReplayState(state *httpstore.AcceptedReplayState) (*httpstore.AcceptedReplayState, bool)
- func (c *Component) BeginActiveLeases(set *httpstore.ActiveLeaseSet, token httpstore.ActiveLeaseToken) (*httpstore.ActiveLeaseSnapshot, error)
- func (c *Component) BeginReconcileRender() (uint64, error)
- func (c *Component) ChangesSince(revision httpstore.Revision) (httpstore.Revision, []httpstore.SemanticChange, bool)
- func (c *Component) CommitInitialCandidates(ctx context.Context, candidates []*httpstore.InitialCandidate) error
- func (c *Component) CommitInitialCandidatesAndVerify(ctx context.Context, candidates []*httpstore.InitialCandidate, ...) ([]httpstore.CandidateCommit, httpstore.Revision, error)
- func (c *Component) CommitInitialCandidatesAndVerifyObservations(ctx context.Context, candidates []*httpstore.InitialCandidate, ...) ([]httpstore.CandidateCommit, httpstore.Revision, error)
- func (c *Component) ConfirmAcceptances(observations []httpstore.ObservationToken)
- func (c *Component) GetStore() *httpstore.HTTPStore
- func (c *Component) HoldReconcileRenders(epoch uint64, err error)
- func (c *Component) Name() string
- func (c *Component) NewActiveLeaseSet() (*httpstore.ActiveLeaseSet, httpstore.ActiveLeaseToken, error)
- func (c *Component) PrepareInitialCandidatesAndVerifyObservations(ctx context.Context, candidates []*purehttpstore.InitialCandidate, ...) (*preparedCandidateCommit, error)
- func (c *Component) PrepareObservationCommitWithActiveLeases(ctx context.Context, observations []purehttpstore.ObservationToken, ...) (*PreparedInputCommit, error)
- func (c *Component) ReconcileRenderCompleted()
- func (c *Component) ReconcileSource(url string, opts httpstore.FetchOptions, auth *httpstore.AuthConfig) (httpstore.SourceState, error)
- func (c *Component) ReconcileURL(url string)
- func (c *Component) RegisterURL(url string)
- func (c *Component) ReplayWatermark() httpstore.Revision
- func (c *Component) RequestRenderForAcceptedContent()
- func (c *Component) RequestRenderForWithheldContent()
- func (c *Component) RetireActiveLeases(set *httpstore.ActiveLeaseSet, token httpstore.ActiveLeaseToken) error
- func (c *Component) RevisionSource() httpstore.SourceID
- func (c *Component) RevokeAcceptances(sequence uint64) int
- func (c *Component) Start(ctx context.Context) error
- func (c *Component) StopRefresher(url string)
- func (c *Component) VerifyObservations(tokens []httpstore.ObservationToken) bool
- func (c *Component) VerifyReplayEpoch(epoch *httpstore.ReplayEpoch) bool
- func (c *Component) VerifySnapshots(tokens []httpstore.SnapshotToken) bool
- func (c *Component) Watermark() httpstore.Revision
- type CriticalFetchError
- type DeferredCandidates
- type HTTPStoreWrapper
- func (w *HTTPStoreWrapper) CandidateWithheld(url string) bool
- func (w *HTTPStoreWrapper) CaptureAcceptedReplayState(snapshots []httpstore.ContentSnapshot) (*httpstore.AcceptedReplayState, bool)
- func (w *HTTPStoreWrapper) CommittedAcceptedReplayState() (*httpstore.AcceptedReplayState, bool)
- func (w *HTTPStoreWrapper) ContentSnapshots() ([]httpstore.ContentSnapshot, bool)
- func (w *HTTPStoreWrapper) Fetch(args ...any) (any, error)
- func (w *HTTPStoreWrapper) FetchSnapshot(args ...any) (any, httpstore.ContentSnapshot, error)
- func (w *HTTPStoreWrapper) InputTransaction() *InputTransaction
- func (w *HTTPStoreWrapper) Pending(url string) bool
- func (w *HTTPStoreWrapper) RenderFailure() error
- func (w *HTTPStoreWrapper) ReplaySnapshot(snapshot *httpstore.ContentSnapshot) (httpstore.ContentSnapshot, bool, error)
- func (w *HTTPStoreWrapper) RequireAcceptedReplayState(state *httpstore.AcceptedReplayState) (*httpstore.AcceptedReplayState, error)
- func (w *HTTPStoreWrapper) RevisionSource() httpstore.SourceID
- type InputRetrySeed
- type InputTransaction
- func (t *InputTransaction) Abort()
- func (t *InputTransaction) Cacheable() bool
- func (t *InputTransaction) Commit(ctx context.Context) error
- func (t *InputTransaction) HTTPObservations() []purehttpstore.ObservationToken
- func (t *InputTransaction) HasCandidates() bool
- func (t *InputTransaction) PrepareCommit(ctx context.Context) (*PreparedInputCommit, error)
- func (t *InputTransaction) PrepareCommitPreservingRefreshers(ctx context.Context, additional []purehttpstore.ObservationToken, ...) (*PreparedInputCommit, error)
- func (t *InputTransaction) PrepareCommitWithObservations(ctx context.Context, additional []purehttpstore.ObservationToken) (*PreparedInputCommit, error)
- func (t *InputTransaction) PrepareCommitWithObservationsAndActiveLeases(ctx context.Context, additional []purehttpstore.ObservationToken, ...) (*PreparedInputCommit, error)
- func (t *InputTransaction) ProvisionalURLs() []string
- func (t *InputTransaction) RetrySeed() *InputRetrySeed
- func (t *InputTransaction) Snapshots() []purehttpstore.ContentSnapshot
- func (t *InputTransaction) Withheld(url string) bool
- type PreparedInputCommit
- func (c *PreparedInputCommit) Abort()
- func (c *PreparedInputCommit) CommitPublishedPublication() error
- func (c *PreparedInputCommit) PlannedActiveLeases() (purehttpstore.ActiveLeaseToken, purehttpstore.ActiveLeaseTransition, bool)
- func (c *PreparedInputCommit) Publish() bool
- func (c *PreparedInputCommit) PublishSealed()
- func (c *PreparedInputCommit) Release()
- func (c *PreparedInputCommit) ReleaseCommittedPublication()
- func (c *PreparedInputCommit) SealPublication() error
- func (c *PreparedInputCommit) ValidatePublication() error
- func (c *PreparedInputCommit) ValidatePublishedPublication() error
- type SourceMode
Constants ¶
const ( // ComponentName is the unique identifier for this component. ComponentName = "httpstore" // EventBufferSize is the size of the event subscription buffer. // Low-volume component handling validation events (~1-2 per reconciliation); // HTTP refresh operations are timer-driven, not event-driven. EventBufferSize = busevents.StandardSubscriberBuffer )
const DefaultOutageRetryInterval = 30 * time.Second
DefaultOutageRetryInterval paces refetching an unavailable critical source that declares no refresh interval.
Variables ¶
var ErrCandidatePending = errors.New("HTTP candidates are being fetched outside the render")
ErrCandidatePending discards a render until its HTTP candidates have been fetched.
var ErrCandidateWithheld = errors.New("HTTP content is not accepted yet and this render does not accept new content")
ErrCandidateWithheld reports a critical source that a render left out because its content was not accepted yet.
var ErrCriticalFetchFailed = errors.New("critical http.Fetch failed")
ErrCriticalFetchFailed prevents resource isolation from retrying an unavailable HTTP input.
Functions ¶
func CandidatesWithheld ¶
CandidatesWithheld reports whether the render must not accept new HTTP content.
func ParseFetchArgs ¶
func ParseFetchArgs(args []any) (string, httpstore.FetchOptions, *httpstore.AuthConfig, error)
ParseFetchArgs extracts and validates the URL, options, and auth of an http.Fetch call.
Types ¶
type Component ¶
type Component struct {
// contains filtered or unexported fields
}
Component wraps HTTPStore with event coordination.
It manages:
- Refresh timers for URLs with interval > 0
- Event publishing when content changes
- Pending content promotion/rejection based on proposal validation results
- Periodic eviction of unused cache entries
Event subscriptions:
- ProposalValidationCompletedEvent: Check if our validation, promote/reject pending
Event publications:
- ProposalValidationRequestedEvent: When refreshed content differs from accepted
- HTTPResourceAcceptedEvent: When pending content is promoted
- ReconciliationTriggeredEvent: After successful validation promotion
func New ¶
func New(eventBus *busevents.EventBus, logger *slog.Logger, evictionMaxAge time.Duration) *Component
New creates a new HTTPStore event adapter component.
The component subscribes to the EventBus during construction (before EventBus.Start()) to ensure proper startup synchronization.
Parameters:
- eventBus: The event bus for coordination
- logger: Logger for debug messages
- evictionMaxAge: Maximum age for unused entries before eviction (0 disables eviction)
func (*Component) AcceptanceSequence ¶
AcceptanceSequence counts the content acceptances on this replica so far.
func (*Component) AcceptedSnapshot ¶
func (c *Component) AcceptedSnapshot( url string, descriptor httpstore.SourceDescriptor, ) (httpstore.ContentSnapshot, bool)
AcceptedSnapshot returns the current accepted bytes for one exact declaration.
func (*Component) AdvanceAcceptedReplayState ¶
func (c *Component) AdvanceAcceptedReplayState( state *httpstore.AcceptedReplayState, ) (*httpstore.AcceptedReplayState, bool)
AdvanceAcceptedReplayState rebases selective replay state across unrelated changes.
func (*Component) BeginActiveLeases ¶
func (c *Component) BeginActiveLeases( set *httpstore.ActiveLeaseSet, token httpstore.ActiveLeaseToken, ) (*httpstore.ActiveLeaseSnapshot, error)
BeginActiveLeases captures exact relevant changes for one render cache.
func (*Component) BeginReconcileRender ¶
BeginReconcileRender returns the failure a reconcile render would only repeat, or the epoch to hold at if this render fails on unavailable content.
func (*Component) ChangesSince ¶
func (c *Component) ChangesSince(revision httpstore.Revision) ( httpstore.Revision, []httpstore.SemanticChange, bool, )
ChangesSince returns exact accepted HTTP changes after revision.
func (*Component) CommitInitialCandidates ¶
func (c *Component) CommitInitialCandidates( ctx context.Context, candidates []*httpstore.InitialCandidate, ) error
CommitInitialCandidates accepts one complete validated render input set.
func (*Component) CommitInitialCandidatesAndVerify ¶
func (c *Component) CommitInitialCandidatesAndVerify( ctx context.Context, candidates []*httpstore.InitialCandidate, accepted []httpstore.SnapshotToken, ) ([]httpstore.CandidateCommit, httpstore.Revision, error)
CommitInitialCandidatesAndVerify accepts candidates only if all content read earlier in the render still has the same accepted versions.
func (*Component) CommitInitialCandidatesAndVerifyObservations ¶
func (c *Component) CommitInitialCandidatesAndVerifyObservations( ctx context.Context, candidates []*httpstore.InitialCandidate, observations []httpstore.ObservationToken, ) ([]httpstore.CandidateCommit, httpstore.Revision, error)
CommitInitialCandidatesAndVerifyObservations accepts candidates only if all exact present and negative reads still match.
func (*Component) ConfirmAcceptances ¶
func (c *Component) ConfirmAcceptances(observations []httpstore.ObservationToken)
ConfirmAcceptances settles exact source versions read by a passing render.
func (*Component) GetStore ¶
GetStore returns the underlying HTTPStore. This is used by the wrapper to access cached content.
func (*Component) HoldReconcileRenders ¶
HoldReconcileRenders pauses reconcile renders after one, begun at epoch, failed because a critical source is unavailable. Renders resume when the source answers, or after its next failed refetch if a render was skipped.
func (*Component) Name ¶
Name returns the unique identifier for this component. Implements the lifecycle.Component interface.
func (*Component) NewActiveLeaseSet ¶
func (c *Component) NewActiveLeaseSet() ( *httpstore.ActiveLeaseSet, httpstore.ActiveLeaseToken, error, )
NewActiveLeaseSet allocates an empty persistent render-cache lease owner.
func (*Component) PrepareInitialCandidatesAndVerifyObservations ¶
func (c *Component) PrepareInitialCandidatesAndVerifyObservations( ctx context.Context, candidates []*purehttpstore.InitialCandidate, observations []purehttpstore.ObservationToken, ) (*preparedCandidateCommit, error)
func (*Component) PrepareObservationCommitWithActiveLeases ¶
func (c *Component) PrepareObservationCommitWithActiveLeases( ctx context.Context, observations []purehttpstore.ObservationToken, active *purehttpstore.ActiveLeaseCommit, ) (*PreparedInputCommit, error)
PrepareObservationCommitWithActiveLeases prepares verification and one persistent render cache lease transition without a fetch transaction.
func (*Component) ReconcileRenderCompleted ¶
func (c *Component) ReconcileRenderCompleted()
ReconcileRenderCompleted ends every outage: a completed render needed none of those sources, since an unavailable critical source fails its render.
func (*Component) ReconcileSource ¶
func (c *Component) ReconcileSource( url string, opts httpstore.FetchOptions, auth *httpstore.AuthConfig, ) (httpstore.SourceState, error)
ReconcileSource serializes source, timer, and validation-batch authority.
func (*Component) ReconcileURL ¶
ReconcileURL re-arms or stops a URL timer when its source policy changes.
func (*Component) RegisterURL ¶
RegisterURL reconciles a URL's timer with its current source policy.
func (*Component) ReplayWatermark ¶
ReplayWatermark returns the complete render-relevant HTTP source epoch.
func (*Component) RequestRenderForAcceptedContent ¶
func (c *Component) RequestRenderForAcceptedContent()
RequestRenderForAcceptedContent triggers a reconcile for content a render accepted without publishing its cache.
func (*Component) RequestRenderForWithheldContent ¶
func (c *Component) RequestRenderForWithheldContent()
RequestRenderForWithheldContent asks for the acceptance attempt for content a deploying render left out.
func (*Component) RetireActiveLeases ¶
func (c *Component) RetireActiveLeases( set *httpstore.ActiveLeaseSet, token httpstore.ActiveLeaseToken, ) error
RetireActiveLeases removes one render cache's leases and refresh timers.
func (*Component) RevisionSource ¶
RevisionSource identifies this component's accepted HTTP content stream.
func (*Component) RevokeAcceptances ¶
RevokeAcceptances takes back the unconfirmed acceptances up to sequence, because HAProxy refused a render that may have read them, and asks for the render without them. It returns how many it revoked.
func (*Component) Start ¶
Start begins the component's event loop.
This method blocks until the context is cancelled.
func (*Component) StopRefresher ¶
StopRefresher stops the refresh timer for a specific URL.
func (*Component) VerifyObservations ¶
func (c *Component) VerifyObservations(tokens []httpstore.ObservationToken) bool
VerifyObservations checks exact present and negative HTTP reads.
func (*Component) VerifyReplayEpoch ¶
func (c *Component) VerifyReplayEpoch(epoch *httpstore.ReplayEpoch) bool
VerifyReplayEpoch verifies the complete render-relevant HTTP root.
func (*Component) VerifySnapshots ¶
func (c *Component) VerifySnapshots(tokens []httpstore.SnapshotToken) bool
VerifySnapshots checks that every accepted HTTP token is still current.
type CriticalFetchError ¶
type CriticalFetchError struct {
Cause error
}
CriticalFetchError reports a critical source the render could not read.
func (*CriticalFetchError) Error ¶
func (e *CriticalFetchError) Error() string
func (*CriticalFetchError) Is ¶
func (e *CriticalFetchError) Is(target error) bool
func (*CriticalFetchError) Unwrap ¶
func (e *CriticalFetchError) Unwrap() error
type DeferredCandidates ¶
type DeferredCandidates struct {
// contains filtered or unexported fields
}
DeferredCandidates retains only source reads while the pipeline releases its render graph.
func WithDeferredCandidates ¶
func WithDeferredCandidates(ctx context.Context) (context.Context, *DeferredCandidates)
WithDeferredCandidates moves initial HTTP I/O outside a pipeline's render attempts.
func (*DeferredCandidates) Await ¶
func (d *DeferredCandidates) Await(ctx context.Context) (bool, error)
Await waits only after the render and its cold gate have been released.
func (*DeferredCandidates) Close ¶
func (d *DeferredCandidates) Close()
Close cancels and drains every fetch owned by this pipeline execution.
func (*DeferredCandidates) Discard ¶
func (d *DeferredCandidates) Discard()
Discard drops staged reads before retrying a failed publication fence.
type HTTPStoreWrapper ¶
type HTTPStoreWrapper struct {
// contains filtered or unexported fields
}
HTTPStoreWrapper exposes HTTPStore content to one template render.
func NewHTTPStoreWrapper ¶
func NewHTTPStoreWrapper( ctx context.Context, component *Component, logger *slog.Logger, overlay stores.HTTPContentOverlay, sourceMode SourceMode, ) *HTTPStoreWrapper
NewHTTPStoreWrapper creates a new HTTPStoreWrapper.
func NewHTTPStoreWrapperWithRetrySeed ¶
func NewHTTPStoreWrapperWithRetrySeed( ctx context.Context, component *Component, logger *slog.Logger, overlay stores.HTTPContentOverlay, sourceMode SourceMode, retrySeed *InputRetrySeed, ) *HTTPStoreWrapper
NewHTTPStoreWrapperWithRetrySeed creates a wrapper with detached retry inputs.
func (*HTTPStoreWrapper) CandidateWithheld ¶
func (w *HTTPStoreWrapper) CandidateWithheld(url string) bool
CandidateWithheld reports whether this render left the source out because its content was not accepted yet.
func (*HTTPStoreWrapper) CaptureAcceptedReplayState ¶
func (w *HTTPStoreWrapper) CaptureAcceptedReplayState( snapshots []httpstore.ContentSnapshot, ) (*httpstore.AcceptedReplayState, bool)
CaptureAcceptedReplayState binds every accepted read to one selective cursor.
func (*HTTPStoreWrapper) CommittedAcceptedReplayState ¶
func (w *HTTPStoreWrapper) CommittedAcceptedReplayState() (*httpstore.AcceptedReplayState, bool)
CommittedAcceptedReplayState returns the exact HTTP publication retained by this render.
func (*HTTPStoreWrapper) ContentSnapshots ¶
func (w *HTTPStoreWrapper) ContentSnapshots() ([]httpstore.ContentSnapshot, bool)
ContentSnapshots returns the exact HTTP versions read by this render.
func (*HTTPStoreWrapper) Fetch ¶
func (w *HTTPStoreWrapper) Fetch(args ...any) (any, error)
Fetch fetches content from a URL.
Template usage:
Basic fetch (no refresh):
{{ http.Fetch("https://example.com/data.txt") }}
With a refresh interval for re-checking accepted content:
{{ http.Fetch("https://example.com/data.txt", {"interval": "60s"}) }}
With options:
{{ http.Fetch("https://example.com/data.txt", {"interval": "5m", "timeout": "30s", "retries": 3, "critical": true}) }}
With authentication:
{{ http.Fetch("https://api.example.com/data", {"interval": "5m"}, {"type": "bearer", "token": token}) }}
{{ http.Fetch("https://api.example.com/data", {"interval": "5m"}, {"type": "basic", "username": user, "password": pass}) }}
Parameters (variadic):
- url (string, required): The HTTP(S) URL to fetch
- options (map, optional): {"interval": "60s", "timeout": "30s", "retries": 3, "critical": true}
- auth (map, optional): {"type": "bearer"|"basic"|"header", "token": "...", "username": "...", "password": "..."}
Returns:
- Content string (empty if fetch failed and not critical)
- Error if critical fetch fails
func (*HTTPStoreWrapper) FetchSnapshot ¶
func (w *HTTPStoreWrapper) FetchSnapshot(args ...any) (any, httpstore.ContentSnapshot, error)
FetchSnapshot performs one fetch and returns the exact input version used by this call.
func (*HTTPStoreWrapper) InputTransaction ¶
func (w *HTTPStoreWrapper) InputTransaction() *InputTransaction
InputTransaction returns the authoritative render's candidate transaction.
func (*HTTPStoreWrapper) Pending ¶
func (w *HTTPStoreWrapper) Pending(url string) bool
Pending reports whether this render left the URL out because its content waits for a render that can accept it.
func (*HTTPStoreWrapper) RenderFailure ¶
func (w *HTTPStoreWrapper) RenderFailure() error
RenderFailure preserves required fetch errors even when Scriggo discards a call's error value.
func (*HTTPStoreWrapper) ReplaySnapshot ¶
func (w *HTTPStoreWrapper) ReplaySnapshot( snapshot *httpstore.ContentSnapshot, ) (httpstore.ContentSnapshot, bool, error)
ReplaySnapshot pins a cached accepted dependency without performing network I/O.
func (*HTTPStoreWrapper) RequireAcceptedReplayState ¶
func (w *HTTPStoreWrapper) RequireAcceptedReplayState( state *httpstore.AcceptedReplayState, ) (*httpstore.AcceptedReplayState, error)
RequireAcceptedReplayState adds selective accepted HTTP inputs to the end fence.
func (*HTTPStoreWrapper) RevisionSource ¶
func (w *HTTPStoreWrapper) RevisionSource() httpstore.SourceID
RevisionSource identifies the accepted content stream observed by this wrapper.
type InputRetrySeed ¶
type InputRetrySeed struct {
// contains filtered or unexported fields
}
InputRetrySeed carries immutable HTTP reads across one internal render retry.
type InputTransaction ¶
type InputTransaction struct {
// contains filtered or unexported fields
}
InputTransaction owns authoritative HTTP candidates for one render.
func (*InputTransaction) Abort ¶
func (t *InputTransaction) Abort()
Abort discards render-local candidates.
func (*InputTransaction) Cacheable ¶
func (t *InputTransaction) Cacheable() bool
Cacheable reports whether every HTTP read produced an exact content version.
func (*InputTransaction) Commit ¶
func (t *InputTransaction) Commit(ctx context.Context) error
Commit atomically accepts every candidate used by the validated render.
func (*InputTransaction) HTTPObservations ¶
func (t *InputTransaction) HTTPObservations() []purehttpstore.ObservationToken
HTTPObservations identifies accepted versions this execution actually read.
func (*InputTransaction) HasCandidates ¶
func (t *InputTransaction) HasCandidates() bool
HasCandidates reports whether this render accepted HTTP content no previous render had. Only such a render needs the synchronous check before its commit: content already in the store was checked when it was first accepted.
func (*InputTransaction) PrepareCommit ¶
func (t *InputTransaction) PrepareCommit(ctx context.Context) (*PreparedInputCommit, error)
PrepareCommit validates every input and retains publication authority.
func (*InputTransaction) PrepareCommitPreservingRefreshers ¶
func (t *InputTransaction) PrepareCommitPreservingRefreshers( ctx context.Context, additional []purehttpstore.ObservationToken, active *purehttpstore.ActiveLeaseCommit, ) (*PreparedInputCommit, error)
PrepareCommitPreservingRefreshers publishes inputs without changing timer ownership.
func (*InputTransaction) PrepareCommitWithObservations ¶
func (t *InputTransaction) PrepareCommitWithObservations( ctx context.Context, additional []purehttpstore.ObservationToken, ) (*PreparedInputCommit, error)
PrepareCommitWithObservations also validates exact inputs held by a render graph.
func (*InputTransaction) PrepareCommitWithObservationsAndActiveLeases ¶
func (t *InputTransaction) PrepareCommitWithObservationsAndActiveLeases( ctx context.Context, additional []purehttpstore.ObservationToken, active *purehttpstore.ActiveLeaseCommit, ) (*PreparedInputCommit, error)
PrepareCommitWithObservationsAndActiveLeases also prepares one render cache's exact persistent HTTP dependency transition.
func (*InputTransaction) ProvisionalURLs ¶
func (t *InputTransaction) ProvisionalURLs() []string
func (*InputTransaction) RetrySeed ¶
func (t *InputTransaction) RetrySeed() *InputRetrySeed
RetrySeed snapshots fetched inputs without transferring transaction state.
func (*InputTransaction) Snapshots ¶
func (t *InputTransaction) Snapshots() []purehttpstore.ContentSnapshot
Snapshots returns the exact versions read by this render.
func (*InputTransaction) Withheld ¶
func (t *InputTransaction) Withheld(url string) bool
Withheld reports whether this render left the source out because it was not accepted yet.
type PreparedInputCommit ¶
type PreparedInputCommit struct {
// contains filtered or unexported fields
}
PreparedInputCommit retains HTTP input authority across coordinated publication.
func (*PreparedInputCommit) Abort ¶
func (c *PreparedInputCommit) Abort()
Abort rolls back a tentative publication and releases retained authority.
func (*PreparedInputCommit) CommitPublishedPublication ¶
func (c *PreparedInputCommit) CommitPublishedPublication() error
CommitPublishedPublication records a rollback-capable publication decision.
func (*PreparedInputCommit) PlannedActiveLeases ¶
func (c *PreparedInputCommit) PlannedActiveLeases() ( purehttpstore.ActiveLeaseToken, purehttpstore.ActiveLeaseTransition, bool, )
PlannedActiveLeases returns the lease token published with this commit.
func (*PreparedInputCommit) Publish ¶
func (c *PreparedInputCommit) Publish() bool
Publish reports whether publication won over Abort.
func (*PreparedInputCommit) PublishSealed ¶
func (c *PreparedInputCommit) PublishSealed()
PublishSealed completes a publication returned successfully from SealPublication.
func (*PreparedInputCommit) Release ¶
func (c *PreparedInputCommit) Release()
Release exposes the coordinated publication and releases retained authority.
func (*PreparedInputCommit) ReleaseCommittedPublication ¶
func (c *PreparedInputCommit) ReleaseCommittedPublication()
ReleaseCommittedPublication exposes committed state and releases retained authority.
func (*PreparedInputCommit) SealPublication ¶
func (c *PreparedInputCommit) SealPublication() error
SealPublication retains an authenticated terminal publication with no remaining fallible work.
func (*PreparedInputCommit) ValidatePublication ¶
func (c *PreparedInputCommit) ValidatePublication() error
ValidatePublication verifies that the retained commit can enter its terminal publication.
func (*PreparedInputCommit) ValidatePublishedPublication ¶
func (c *PreparedInputCommit) ValidatePublishedPublication() error
ValidatePublishedPublication authenticates tentative live state without releasing authority.
type SourceMode ¶
type SourceMode uint8
SourceMode controls whether a render may replace the shared HTTP source.
const ( // SourceModeReadOnly keeps source declarations and fetched content local to one render. SourceModeReadOnly SourceMode = iota // SourceModeAuthoritative reconciles accepted sources and their refresh timers. SourceModeAuthoritative )