Documentation
¶
Index ¶
- func ApplyAdminDashboardHardInvalidation(parseCtx context.Context, parseStorage cachecore.Storage, ...) (int, error)
- func ApplyBillingSummaryUnavailable(parseCtx context.Context, parseStorage cachecore.Storage, ...) error
- func ApplyLocaleCatalogInvalidationForLocaleChange(parseCtx context.Context, parseStorage cachecore.Storage, ...) (int, error)
- func ApplyLocaleCatalogInvalidationForServerVersionChange(parseCtx context.Context, parseStorage cachecore.Storage, ...) (int, error)
- func ApplyModelCatalogInvalidationForVersionHashChange(parseCtx context.Context, parseStorage cachecore.Storage, ...) (int, error)
- func ApplySettingsSnapshotWriteFailure(parseCtx context.Context, parseStorage cachecore.Storage, ...) error
- func ApplySettingsSnapshotWriteSuccess(parseCtx context.Context, parseStorage cachecore.Storage, ...) error
- func ApplyThreadDraftDiscardAfterSend(parseCtx context.Context, parseStorage cachecore.Storage, ...) (int, error)
- func ApplyThreadDraftDiscardByUserClear(parseCtx context.Context, parseStorage cachecore.Storage, ...) (int, error)
- func ApplyThreadHistoryAuthoritativeReconcile(parseCtx context.Context, parseReconciler *cachecore.WorkerSnapshotReconciler, ...) (cachecore.WorkerSnapshotReconcileResult, error)
- func ApplyThreadHistoryStreamPatch(parseCtx context.Context, parseStorage cachecore.Storage, ...) error
- func ApplyUndeliveredLogAck(parseCtx context.Context, parseStorage cachecore.Storage, parseScopeKey string, ...) (int, error)
- func ApplyUnsentMessageAck(parseCtx context.Context, parseStorage cachecore.Storage, parseScopeKey string, ...) (int, error)
- func ApplyUnsentMessageRouteNormalization(parseCtx context.Context, parseStorage cachecore.Storage, parseScopeKey string, ...) (int, error)
- func BuildAdminDashboardResourceKey(parseRoleScope string, parseSurface string, parseLookbackDays int) string
- func BuildAdminDashboardSnapshotPayloadJSON(parsePayload AdminDashboardSnapshotPayload) ([]byte, error)
- func BuildAdminDashboardSnapshotPolicy() cachecore.CachePolicy
- func BuildBillingSummarySnapshotPayloadJSON(parsePayload BillingSummarySnapshotPayload) ([]byte, error)
- func BuildBillingSummarySnapshotPolicy() cachecore.CachePolicy
- func BuildCanvasSessionResourceKey(parseRouteKey string) string
- func BuildCanvasSessionSnapshotPayloadJSON(parsePayload CanvasSessionSnapshotPayload) ([]byte, error)
- func BuildCanvasSessionSnapshotPolicy() cachecore.CachePolicy
- func BuildConversationListAnchorResourceKey(parseRouteKey string) string
- func BuildConversationListPagePayloadJSON(parseHasMore bool, parseAnchorConversationPublicID string, ...) ([]byte, error)
- func BuildConversationListPagePolicy() cachecore.CachePolicy
- func BuildConversationListPageResourceKey(parsePageCursor string, parsePageSize int) string
- func BuildLocaleCatalogPolicy() cachecore.CachePolicy
- func BuildLocaleCatalogResourceKey(parseLocale string, parseNamespace string, parseBundleVersion string) string
- func BuildModelCatalogResourceKey(parseMetadataClass string, parseServerVersion string, parseCatalogHash string) string
- func BuildModelCatalogSnapshotPolicy() cachecore.CachePolicy
- func BuildSettingsSnapshotPolicy() cachecore.CachePolicy
- func BuildSettingsSnapshotResourceKey(parseSection string) string
- func BuildThreadDraftPolicy() cachecore.CachePolicy
- func BuildThreadDraftResourceKey(parseThreadRoutePublicID string) string
- func BuildThreadHistoryPolicy() cachecore.CachePolicy
- func BuildThreadHistoryResourceKey(parseThreadRoutePublicID string) string
- func BuildUndeliveredLogQueueKey(parseScopeKey string) string
- func BuildUnsentMessageQueueKey(parseScopeKey string, parseThreadRoutePublicID string) string
- func GetUndeliveredLogQueue(parseCtx context.Context, parseStorage cachecore.Storage, parseScopeKey string) ([]cachecore.OutboxRecordEnvelope, error)
- func GetUndeliveredLogRetryBatchOnReconnect(parseCtx context.Context, parseStorage cachecore.Storage, parseScopeKey string, ...) ([]cachecore.OutboxRecordEnvelope, error)
- func GetUnsentMessageQueue(parseCtx context.Context, parseStorage cachecore.Storage, parseScopeKey string, ...) ([]cachecore.OutboxRecordEnvelope, error)
- func GetUnsentMessageRetryBatchOnReconnect(parseCtx context.Context, parseStorage cachecore.Storage, parseScopeKey string, ...) ([]cachecore.OutboxRecordEnvelope, error)
- func ReadAdminDashboardSnapshot(parseCtx context.Context, parseAPI *cachecore.UIAPI, ...) (cachecore.CachedResourceView, error)
- func ReadBillingSummarySnapshot(parseCtx context.Context, parseAPI *cachecore.UIAPI, parseScopeKey string, ...) (cachecore.CachedResourceView, error)
- func ReadCanvasSessionSnapshot(parseCtx context.Context, parseAPI *cachecore.UIAPI, parseScopeKey string, ...) (cachecore.CachedResourceView, error)
- func ReadConversationListPage(parseCtx context.Context, parseAPI *cachecore.UIAPI, ...) (cachecore.CachedResourceView, error)
- func ReadConversationListScrollAnchor(parseCtx context.Context, parseAPI *cachecore.UIAPI, parseScopeKey string, ...) (cachecore.CachedResourceView, error)
- func ReadLocaleCatalogResource(parseCtx context.Context, parseAPI *cachecore.UIAPI, ...) (cachecore.CachedResourceView, error)
- func ReadModelCatalogSnapshot(parseCtx context.Context, parseAPI *cachecore.UIAPI, ...) (cachecore.CachedResourceView, error)
- func ReadSettingsSnapshot(parseCtx context.Context, parseAPI *cachecore.UIAPI, parseScopeKey string, ...) (cachecore.CachedResourceView, error)
- func ReadThreadDraft(parseCtx context.Context, parseAPI *cachecore.UIAPI, parseScopeKey string, ...) (cachecore.CachedResourceView, error)
- func ReadThreadHistory(parseCtx context.Context, parseAPI *cachecore.UIAPI, parseScopeKey string, ...) (cachecore.CachedResourceView, error)
- func StoreAdminDashboardSnapshot(parseCtx context.Context, parseStorage cachecore.Storage, ...) error
- func StoreBillingSummarySnapshot(parseCtx context.Context, parseStorage cachecore.Storage, parseScopeKey string, ...) error
- func StoreCanvasSessionSnapshot(parseCtx context.Context, parseStorage cachecore.Storage, parseScopeKey string, ...) error
- func StoreConversationListPage(parseCtx context.Context, parseStorage cachecore.Storage, ...) error
- func StoreConversationListScrollAnchor(parseCtx context.Context, parseStorage cachecore.Storage, parseScopeKey string, ...) error
- func StoreLocaleCatalogResource(parseCtx context.Context, parseStorage cachecore.Storage, ...) error
- func StoreModelCatalogSnapshot(parseCtx context.Context, parseStorage cachecore.Storage, ...) error
- func StoreSettingsSnapshot(parseCtx context.Context, parseStorage cachecore.Storage, parseScopeKey string, ...) error
- func StoreThreadDraft(parseCtx context.Context, parseStorage cachecore.Storage, parseScopeKey string, ...) error
- func StoreThreadHistorySnapshot(parseCtx context.Context, parseStorage cachecore.Storage, parseScopeKey string, ...) error
- func StoreUndeliveredLog(parseCtx context.Context, parseStorage cachecore.Storage, parseScopeKey string, ...) error
- func StoreUnsentMessage(parseCtx context.Context, parseStorage cachecore.Storage, parseScopeKey string, ...) error
- type AdminDashboardSnapshotInput
- type AdminDashboardSnapshotPayload
- type BillingSummarySnapshotPayload
- type CanvasSessionSnapshotPayload
- type ConversationListPageInput
- type ConversationListPagePayload
- type ExampleCacheConsistencyMode
- type ExampleCachePolicyEntry
- type LocaleCatalogReadInput
- type ModelCatalogSnapshotInput
- type ReconnectConflictResolutionInput
- type ReconnectConflictResolutionResult
- type UndeliveredLogOutboxPolicy
- type UnsentMessageOutboxPolicy
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ApplyAdminDashboardHardInvalidation ¶
func ApplyAdminDashboardHardInvalidation(parseCtx context.Context, parseStorage cachecore.Storage, parseSnapshot *cachecore.SnapshotStore) (int, error)
ApplyAdminDashboardHardInvalidation evicts all admin dashboard cache snapshots for role/session/workspace scope changes.
func ApplyBillingSummaryUnavailable ¶
func ApplyBillingSummaryUnavailable(parseCtx context.Context, parseStorage cachecore.Storage, parseSnapshot *cachecore.SnapshotStore, parseScopeKey string, parseReason string) error
ApplyBillingSummaryUnavailable marks one cached billing snapshot as stale/unavailable while preserving the last payload.
func ApplyLocaleCatalogInvalidationForLocaleChange ¶
func ApplyLocaleCatalogInvalidationForLocaleChange(parseCtx context.Context, parseStorage cachecore.Storage, parseSnapshot *cachecore.SnapshotStore, parseActiveLocale string) (int, error)
ApplyLocaleCatalogInvalidationForLocaleChange evicts locale-catalog entries that do not match one active locale.
func ApplyLocaleCatalogInvalidationForServerVersionChange ¶
func ApplyLocaleCatalogInvalidationForServerVersionChange(parseCtx context.Context, parseStorage cachecore.Storage, parseSnapshot *cachecore.SnapshotStore, parseActiveBundleVersion string) (int, error)
ApplyLocaleCatalogInvalidationForServerVersionChange evicts locale-catalog entries that do not match one active bundle version.
func ApplyModelCatalogInvalidationForVersionHashChange ¶
func ApplyModelCatalogInvalidationForVersionHashChange(parseCtx context.Context, parseStorage cachecore.Storage, parseSnapshot *cachecore.SnapshotStore, parseActiveServerVersion string, parseActiveCatalogHash string) (int, error)
ApplyModelCatalogInvalidationForVersionHashChange evicts model/provider metadata records that mismatch one active version/hash.
func ApplySettingsSnapshotWriteFailure ¶
func ApplySettingsSnapshotWriteFailure(parseCtx context.Context, parseStorage cachecore.Storage, parseSnapshot *cachecore.SnapshotStore, parseScopeKey string, parseSection string, parseUnavailableReason string) error
ApplySettingsSnapshotWriteFailure marks one settings snapshot as stale/unavailable while retaining the last payload.
func ApplySettingsSnapshotWriteSuccess ¶
func ApplySettingsSnapshotWriteSuccess(parseCtx context.Context, parseStorage cachecore.Storage, parseSnapshot *cachecore.SnapshotStore, parseScopeKey string, parseSection string, parseVersion string, parsePayload []byte) error
ApplySettingsSnapshotWriteSuccess merges one successful write payload into the cached settings snapshot.
func ApplyThreadDraftDiscardAfterSend ¶
func ApplyThreadDraftDiscardAfterSend(parseCtx context.Context, parseStorage cachecore.Storage, parseSnapshot *cachecore.SnapshotStore, parseScopeKey string, parseThreadRoutePublicID string) (int, error)
ApplyThreadDraftDiscardAfterSend removes one thread draft after successful message send.
func ApplyThreadDraftDiscardByUserClear ¶
func ApplyThreadDraftDiscardByUserClear(parseCtx context.Context, parseStorage cachecore.Storage, parseSnapshot *cachecore.SnapshotStore, parseScopeKey string, parseThreadRoutePublicID string) (int, error)
ApplyThreadDraftDiscardByUserClear removes one thread draft after explicit user clear action.
func ApplyThreadHistoryAuthoritativeReconcile ¶
func ApplyThreadHistoryAuthoritativeReconcile( parseCtx context.Context, parseReconciler *cachecore.WorkerSnapshotReconciler, parseScopeKey string, parseThreadRoutePublicID string, parseUpdatedAt time.Time, parseRecord cachecore.CacheRecordEnvelope, ) (cachecore.WorkerSnapshotReconcileResult, error)
ApplyThreadHistoryAuthoritativeReconcile merges one authoritative reconnect snapshot through deterministic worker reconciliation.
func ApplyThreadHistoryStreamPatch ¶
func ApplyThreadHistoryStreamPatch( parseCtx context.Context, parseStorage cachecore.Storage, parseSnapshot *cachecore.SnapshotStore, parseScopeKey string, parseThreadRoutePublicID string, parsePatch func([]byte) []byte, ) error
ApplyThreadHistoryStreamPatch applies one streamed assistant-output patch to one cached thread-history record.
func ApplyUndeliveredLogAck ¶
func ApplyUndeliveredLogAck(parseCtx context.Context, parseStorage cachecore.Storage, parseScopeKey string, parseOperationKey string) (int, error)
ApplyUndeliveredLogAck removes one acked undelivered log by operation key.
func ApplyUnsentMessageAck ¶
func ApplyUnsentMessageAck(parseCtx context.Context, parseStorage cachecore.Storage, parseScopeKey string, parseThreadRoutePublicID string, parseOperationKey string) (int, error)
ApplyUnsentMessageAck removes one acked unsent message from one thread-scoped queue.
func ApplyUnsentMessageRouteNormalization ¶
func ApplyUnsentMessageRouteNormalization(parseCtx context.Context, parseStorage cachecore.Storage, parseScopeKey string, parseFromThreadRoutePublicID string, parseToThreadRoutePublicID string) (int, error)
ApplyUnsentMessageRouteNormalization moves queue entries from one thread context into one canonical thread context with op-key dedupe.
func BuildAdminDashboardResourceKey ¶
func BuildAdminDashboardResourceKey(parseRoleScope string, parseSurface string, parseLookbackDays int) string
BuildAdminDashboardResourceKey builds one admin-dashboard cache key keyed by role scope, surface, and lookback range.
func BuildAdminDashboardSnapshotPayloadJSON ¶
func BuildAdminDashboardSnapshotPayloadJSON(parsePayload AdminDashboardSnapshotPayload) ([]byte, error)
BuildAdminDashboardSnapshotPayloadJSON builds one payload JSON contract with explicit last-updated metadata.
func BuildAdminDashboardSnapshotPolicy ¶
func BuildAdminDashboardSnapshotPolicy() cachecore.CachePolicy
BuildAdminDashboardSnapshotPolicy returns one short-lived admin-dashboard read cache policy.
func BuildBillingSummarySnapshotPayloadJSON ¶
func BuildBillingSummarySnapshotPayloadJSON(parsePayload BillingSummarySnapshotPayload) ([]byte, error)
BuildBillingSummarySnapshotPayloadJSON builds one canonical billing-summary payload JSON contract.
func BuildBillingSummarySnapshotPolicy ¶
func BuildBillingSummarySnapshotPolicy() cachecore.CachePolicy
BuildBillingSummarySnapshotPolicy returns one billing-summary snapshot cache policy.
func BuildCanvasSessionResourceKey ¶
BuildCanvasSessionResourceKey builds one canvas/session snapshot resource key for one route context.
func BuildCanvasSessionSnapshotPayloadJSON ¶
func BuildCanvasSessionSnapshotPayloadJSON(parsePayload CanvasSessionSnapshotPayload) ([]byte, error)
BuildCanvasSessionSnapshotPayloadJSON builds one sanitized canvas/session payload JSON contract without debug state.
func BuildCanvasSessionSnapshotPolicy ¶
func BuildCanvasSessionSnapshotPolicy() cachecore.CachePolicy
BuildCanvasSessionSnapshotPolicy returns one canvas/session snapshot cache policy.
func BuildConversationListAnchorResourceKey ¶
BuildConversationListAnchorResourceKey builds one scroll-anchor resource key for one sidebar route context.
func BuildConversationListPagePayloadJSON ¶
func BuildConversationListPagePayloadJSON(parseHasMore bool, parseAnchorConversationPublicID string, parsePagePayload []byte) ([]byte, error)
BuildConversationListPagePayloadJSON builds one JSON payload for has-more plus anchor metadata and page payload bytes.
func BuildConversationListPagePolicy ¶
func BuildConversationListPagePolicy() cachecore.CachePolicy
BuildConversationListPagePolicy returns one page-cache policy tuned for sidebar restore with SWR updates.
func BuildConversationListPageResourceKey ¶
BuildConversationListPageResourceKey builds one conversation-list page resource key from cursor+page-size dimensions.
func BuildLocaleCatalogPolicy ¶
func BuildLocaleCatalogPolicy() cachecore.CachePolicy
BuildLocaleCatalogPolicy returns one policy tuned for locale catalog reuse plus SWR refresh.
func BuildLocaleCatalogResourceKey ¶
func BuildLocaleCatalogResourceKey(parseLocale string, parseNamespace string, parseBundleVersion string) string
BuildLocaleCatalogResourceKey builds one locale+namespace+bundle_version cache key.
func BuildModelCatalogResourceKey ¶
func BuildModelCatalogResourceKey(parseMetadataClass string, parseServerVersion string, parseCatalogHash string) string
BuildModelCatalogResourceKey builds one model-catalog/provider-metadata resource key keyed by server version/hash.
func BuildModelCatalogSnapshotPolicy ¶
func BuildModelCatalogSnapshotPolicy() cachecore.CachePolicy
BuildModelCatalogSnapshotPolicy returns one model-catalog/provider-metadata cache policy.
func BuildSettingsSnapshotPolicy ¶
func BuildSettingsSnapshotPolicy() cachecore.CachePolicy
BuildSettingsSnapshotPolicy returns one settings/profile snapshot cache policy.
func BuildSettingsSnapshotResourceKey ¶
BuildSettingsSnapshotResourceKey builds one settings snapshot key for one section.
func BuildThreadDraftPolicy ¶
func BuildThreadDraftPolicy() cachecore.CachePolicy
BuildThreadDraftPolicy returns one per-thread draft cache policy tuned for quick route-switch restore.
func BuildThreadDraftResourceKey ¶
BuildThreadDraftResourceKey builds one thread-scoped draft cache resource key.
func BuildThreadHistoryPolicy ¶
func BuildThreadHistoryPolicy() cachecore.CachePolicy
BuildThreadHistoryPolicy returns one thread-history cache policy tuned for fast reopen plus frequent refresh.
func BuildThreadHistoryResourceKey ¶
BuildThreadHistoryResourceKey builds one thread-history resource key for one canonical thread route context.
func BuildUndeliveredLogQueueKey ¶
BuildUndeliveredLogQueueKey builds one scoped queue key for undelivered client diagnostics logs.
func BuildUnsentMessageQueueKey ¶
BuildUnsentMessageQueueKey builds one scoped unsent-message queue key for one canonical thread route context.
func GetUndeliveredLogQueue ¶
func GetUndeliveredLogQueue(parseCtx context.Context, parseStorage cachecore.Storage, parseScopeKey string) ([]cachecore.OutboxRecordEnvelope, error)
GetUndeliveredLogQueue lists queued undelivered log records for one scope.
func GetUndeliveredLogRetryBatchOnReconnect ¶
func GetUndeliveredLogRetryBatchOnReconnect(parseCtx context.Context, parseStorage cachecore.Storage, parseScopeKey string, parseNow time.Time, parsePolicy UndeliveredLogOutboxPolicy) ([]cachecore.OutboxRecordEnvelope, error)
GetUndeliveredLogRetryBatchOnReconnect returns one send batch on reconnect, updates retry metadata, and drops capped records.
func GetUnsentMessageQueue ¶
func GetUnsentMessageQueue(parseCtx context.Context, parseStorage cachecore.Storage, parseScopeKey string, parseThreadRoutePublicID string) ([]cachecore.OutboxRecordEnvelope, error)
GetUnsentMessageQueue lists unsent messages queued for one canonical thread route context.
func GetUnsentMessageRetryBatchOnReconnect ¶
func GetUnsentMessageRetryBatchOnReconnect(parseCtx context.Context, parseStorage cachecore.Storage, parseScopeKey string, parseThreadRoutePublicID string, parseNow time.Time, parsePolicy UnsentMessageOutboxPolicy) ([]cachecore.OutboxRecordEnvelope, error)
GetUnsentMessageRetryBatchOnReconnect returns one reconnect send batch and updates retry metadata in-place.
func ReadAdminDashboardSnapshot ¶
func ReadAdminDashboardSnapshot( parseCtx context.Context, parseAPI *cachecore.UIAPI, parseInput AdminDashboardSnapshotInput, parseRefresh func(context.Context, AdminDashboardSnapshotInput) (cachecore.CacheRecordEnvelope, error), ) (cachecore.CachedResourceView, error)
ReadAdminDashboardSnapshot reads one admin dashboard snapshot with snapshot-first SWR behavior.
func ReadBillingSummarySnapshot ¶
func ReadBillingSummarySnapshot( parseCtx context.Context, parseAPI *cachecore.UIAPI, parseScopeKey string, parseRefresh func(context.Context, string, string) (cachecore.CacheRecordEnvelope, error), ) (cachecore.CachedResourceView, error)
ReadBillingSummarySnapshot reads one billing-summary snapshot with snapshot-first SWR behavior.
func ReadCanvasSessionSnapshot ¶
func ReadCanvasSessionSnapshot( parseCtx context.Context, parseAPI *cachecore.UIAPI, parseScopeKey string, parseRouteKey string, parseRefresh func(context.Context, string, string) (cachecore.CacheRecordEnvelope, error), ) (cachecore.CachedResourceView, error)
ReadCanvasSessionSnapshot reads one canvas/session snapshot with snapshot-first SWR behavior.
func ReadConversationListPage ¶
func ReadConversationListPage( parseCtx context.Context, parseAPI *cachecore.UIAPI, parseInput ConversationListPageInput, parseRefresh func(context.Context, ConversationListPageInput) (cachecore.CacheRecordEnvelope, error), ) (cachecore.CachedResourceView, error)
ReadConversationListPage reads one sidebar page with snapshot-first SWR behavior.
func ReadConversationListScrollAnchor ¶
func ReadConversationListScrollAnchor( parseCtx context.Context, parseAPI *cachecore.UIAPI, parseScopeKey string, parseRouteKey string, parseRefresh func(context.Context, string, string) (cachecore.CacheRecordEnvelope, error), ) (cachecore.CachedResourceView, error)
ReadConversationListScrollAnchor reads one sidebar scroll anchor with snapshot-first SWR behavior.
func ReadLocaleCatalogResource ¶
func ReadLocaleCatalogResource( parseCtx context.Context, parseAPI *cachecore.UIAPI, parseInput LocaleCatalogReadInput, parseRefresh func(context.Context, LocaleCatalogReadInput) (cachecore.CacheRecordEnvelope, error), ) (cachecore.CachedResourceView, error)
ReadLocaleCatalogResource reads one locale namespace record from cache with snapshot-first SWR behavior.
func ReadModelCatalogSnapshot ¶
func ReadModelCatalogSnapshot( parseCtx context.Context, parseAPI *cachecore.UIAPI, parseInput ModelCatalogSnapshotInput, parseRefresh func(context.Context, ModelCatalogSnapshotInput) (cachecore.CacheRecordEnvelope, error), ) (cachecore.CachedResourceView, error)
ReadModelCatalogSnapshot reads one model/provider metadata snapshot with snapshot-first SWR behavior.
func ReadSettingsSnapshot ¶
func ReadSettingsSnapshot( parseCtx context.Context, parseAPI *cachecore.UIAPI, parseScopeKey string, parseSection string, parseRefresh func(context.Context, string, string) (cachecore.CacheRecordEnvelope, error), ) (cachecore.CachedResourceView, error)
ReadSettingsSnapshot reads one settings/profile snapshot with snapshot-first SWR behavior.
func ReadThreadDraft ¶
func ReadThreadDraft( parseCtx context.Context, parseAPI *cachecore.UIAPI, parseScopeKey string, parseThreadRoutePublicID string, parseRefresh func(context.Context, string, string) (cachecore.CacheRecordEnvelope, error), ) (cachecore.CachedResourceView, error)
ReadThreadDraft reads one thread draft from cache with snapshot-first policy behavior.
func ReadThreadHistory ¶
func ReadThreadHistory( parseCtx context.Context, parseAPI *cachecore.UIAPI, parseScopeKey string, parseThreadRoutePublicID string, parseRefresh func(context.Context, string, string) (cachecore.CacheRecordEnvelope, error), ) (cachecore.CachedResourceView, error)
ReadThreadHistory reads one thread-history record with snapshot-first SWR behavior.
func StoreAdminDashboardSnapshot ¶
func StoreAdminDashboardSnapshot(parseCtx context.Context, parseStorage cachecore.Storage, parseInput AdminDashboardSnapshotInput, parsePayload AdminDashboardSnapshotPayload) error
StoreAdminDashboardSnapshot stores one short-lived admin dashboard snapshot.
func StoreBillingSummarySnapshot ¶
func StoreBillingSummarySnapshot(parseCtx context.Context, parseStorage cachecore.Storage, parseScopeKey string, parseVersion string, parsePayload BillingSummarySnapshotPayload) error
StoreBillingSummarySnapshot stores one canonical billing snapshot payload.
func StoreCanvasSessionSnapshot ¶
func StoreCanvasSessionSnapshot(parseCtx context.Context, parseStorage cachecore.Storage, parseScopeKey string, parseRouteKey string, parsePayload CanvasSessionSnapshotPayload) error
StoreCanvasSessionSnapshot stores one lightweight canvas/session snapshot payload.
func StoreConversationListPage ¶
func StoreConversationListPage(parseCtx context.Context, parseStorage cachecore.Storage, parseInput ConversationListPageInput, parseBundleVersion string, parsePagePayload []byte, parseHasMore bool, parseAnchorConversationPublicID string) error
StoreConversationListPage stores one conversation-list page snapshot for quick sidebar restore.
func StoreConversationListScrollAnchor ¶
func StoreConversationListScrollAnchor(parseCtx context.Context, parseStorage cachecore.Storage, parseScopeKey string, parseRouteKey string, parseAnchorPayload []byte) error
StoreConversationListScrollAnchor stores one lightweight scroll-memory anchor for sidebar restore.
func StoreLocaleCatalogResource ¶
func StoreLocaleCatalogResource(parseCtx context.Context, parseStorage cachecore.Storage, parseInput LocaleCatalogReadInput, parseBundleHash string, parsePayload []byte) error
StoreLocaleCatalogResource writes one locale namespace payload using the locale catalog policy freshness windows.
func StoreModelCatalogSnapshot ¶
func StoreModelCatalogSnapshot(parseCtx context.Context, parseStorage cachecore.Storage, parseInput ModelCatalogSnapshotInput, parsePayload []byte) error
StoreModelCatalogSnapshot stores one model/provider metadata snapshot payload.
func StoreSettingsSnapshot ¶
func StoreSettingsSnapshot(parseCtx context.Context, parseStorage cachecore.Storage, parseScopeKey string, parseSection string, parseVersion string, parsePayload []byte) error
StoreSettingsSnapshot stores one settings/profile snapshot payload for one section.
func StoreThreadDraft ¶
func StoreThreadDraft(parseCtx context.Context, parseStorage cachecore.Storage, parseScopeKey string, parseThreadRoutePublicID string, parseDraftPayload []byte) error
StoreThreadDraft writes one thread draft payload independently from unsent-message outbox state.
func StoreThreadHistorySnapshot ¶
func StoreThreadHistorySnapshot(parseCtx context.Context, parseStorage cachecore.Storage, parseScopeKey string, parseThreadRoutePublicID string, parseVersion string, parsePayload []byte) error
StoreThreadHistorySnapshot stores one thread-history payload snapshot.
func StoreUndeliveredLog ¶
func StoreUndeliveredLog(parseCtx context.Context, parseStorage cachecore.Storage, parseScopeKey string, parseOperationKey string, parsePayload []byte) error
StoreUndeliveredLog appends one undelivered diagnostics log payload into the retry queue.
func StoreUnsentMessage ¶
func StoreUnsentMessage(parseCtx context.Context, parseStorage cachecore.Storage, parseScopeKey string, parseThreadRoutePublicID string, parseOperationKey string, parsePayload []byte) error
StoreUnsentMessage appends one unsent message payload into one thread-scoped outbox queue and dedupes by operation key.
Types ¶
type AdminDashboardSnapshotInput ¶
type AdminDashboardSnapshotInput struct {
ScopeKey string
RoleScope string
Surface string
LookbackDays int
}
AdminDashboardSnapshotInput stores one admin-dashboard cache envelope keyed by role/surface/scope controls.
type AdminDashboardSnapshotPayload ¶
type AdminDashboardSnapshotPayload struct {
LastUpdated string `json:"last_updated"`
Payload []byte `json:"payload"`
}
AdminDashboardSnapshotPayload stores one cached admin dashboard payload with explicit last-updated metadata.
func ParseAdminDashboardSnapshotPayloadJSON ¶
func ParseAdminDashboardSnapshotPayloadJSON(parseRaw []byte) (AdminDashboardSnapshotPayload, error)
ParseAdminDashboardSnapshotPayloadJSON parses one stored payload JSON contract.
type BillingSummarySnapshotPayload ¶
type BillingSummarySnapshotPayload struct {
PlatformFeeCents int64 `json:"platform_fee_cents"`
RawUsageCents int64 `json:"raw_usage_cents"`
ServicePremiumCents int64 `json:"service_premium_cents"`
TotalCents int64 `json:"total_cents"`
Currency string `json:"currency"`
CapturedAt string `json:"captured_at"`
IsStale bool `json:"is_stale"`
StaleReason string `json:"stale_reason"`
}
BillingSummarySnapshotPayload stores one canonical customer billing snapshot payload.
func ParseBillingSummarySnapshotPayloadJSON ¶
func ParseBillingSummarySnapshotPayloadJSON(parseRaw []byte) (BillingSummarySnapshotPayload, error)
ParseBillingSummarySnapshotPayloadJSON parses one canonical billing-summary payload JSON contract.
type CanvasSessionSnapshotPayload ¶
type CanvasSessionSnapshotPayload struct {
PaneWidthRatio float64 `json:"pane_width_ratio"`
SelectedItemID string `json:"selected_item_id"`
SessionState []byte `json:"session_state"`
DebugState []byte `json:"-"`
}
CanvasSessionSnapshotPayload stores lightweight non-secret canvas/session UI state for refresh restore.
func ParseCanvasSessionSnapshotPayloadJSON ¶
func ParseCanvasSessionSnapshotPayloadJSON(parseRaw []byte) (CanvasSessionSnapshotPayload, error)
ParseCanvasSessionSnapshotPayloadJSON parses one sanitized canvas/session payload JSON contract.
type ConversationListPageInput ¶
ConversationListPageInput stores one conversation-list page cache read/write envelope.
type ConversationListPagePayload ¶
type ConversationListPagePayload struct {
HasMore bool `json:"has_more"`
AnchorConversationPublicID string `json:"anchor_conversation_public_id"`
PagePayload []byte `json:"page_payload"`
}
ConversationListPagePayload stores one cached sidebar page payload plus has-more and anchor metadata.
func ParseConversationListPagePayloadJSON ¶
func ParseConversationListPagePayloadJSON(parseRaw []byte) (ConversationListPagePayload, error)
ParseConversationListPagePayloadJSON parses one stored conversation-list page payload contract.
type ExampleCacheConsistencyMode ¶
type ExampleCacheConsistencyMode string
ExampleCacheConsistencyMode identifies one cache consistency mode used by the example-100 cache policy map.
const ( ExampleCacheConsistencyDisplayOnly ExampleCacheConsistencyMode = "display_only" ExampleCacheConsistencyQueuedWrite ExampleCacheConsistencyMode = "queued_write" ExampleCacheConsistencyAuthoritativeAfterAck ExampleCacheConsistencyMode = "authoritative_after_ack" )
type ExampleCachePolicyEntry ¶
type ExampleCachePolicyEntry struct {
ResourceID string
ResourceKeyPattern string
ScopeKeyShape string
PolicyClass cachecore.PolicyClass
StaleAfter time.Duration
ExpiresAfter time.Duration
InvalidationTriggers []string
OfflineBehavior string
ConsistencyMode ExampleCacheConsistencyMode
}
ExampleCachePolicyEntry stores one teachable cache policy row for one example-100 cached resource.
func BuildExampleCachePolicyMap ¶
func BuildExampleCachePolicyMap() []ExampleCachePolicyEntry
BuildExampleCachePolicyMap returns one complete map of example-100 cache/outbox resources and policy behavior.
func GetExampleCachePolicyEntry ¶
func GetExampleCachePolicyEntry(parseResourceID string) (ExampleCachePolicyEntry, bool)
GetExampleCachePolicyEntry returns one policy map row by resource id.
type LocaleCatalogReadInput ¶
type LocaleCatalogReadInput struct {
ScopeKey string
Locale string
Namespace string
BundleVersion string
}
LocaleCatalogReadInput stores one locale-catalog cache read envelope.
type ModelCatalogSnapshotInput ¶
type ModelCatalogSnapshotInput struct {
ScopeKey string
MetadataClass string
ServerVersion string
CatalogHash string
}
ModelCatalogSnapshotInput stores one model-catalog/provider-metadata cache envelope.
type ReconnectConflictResolutionInput ¶
type ReconnectConflictResolutionInput struct {
ScopeKey string
CanonicalThreadRoutePublicID string
UnsentSourceThreadRoutePublicID string
ThreadUpdatedAt time.Time
AuthoritativeThreadRecord cachecore.CacheRecordEnvelope
AuthoritativeSettingsBySection map[string]cachecore.CacheRecordEnvelope
AckedPreferenceOperationKeys []string
}
ReconnectConflictResolutionInput stores reconnect conflict-resolution inputs across chat, settings, and pending preference edits.
type ReconnectConflictResolutionResult ¶
type ReconnectConflictResolutionResult struct {
UnsentMovedCount int
UnsentDedupedCount int
PreferenceAckedCount int
SettingsUpdatedCount int
IsThreadUpdated bool
}
ReconnectConflictResolutionResult stores one reconnect conflict-resolution summary.
func ApplyReconnectConflictResolution ¶
func ApplyReconnectConflictResolution( parseCtx context.Context, parseStorage cachecore.Storage, parseSnapshot *cachecore.SnapshotStore, parseReconciler *cachecore.WorkerSnapshotReconciler, parseInput ReconnectConflictResolutionInput, ) (ReconnectConflictResolutionResult, error)
ApplyReconnectConflictResolution applies deterministic reconnect reconciliation for unsent messages, settings snapshots, and preference edits.
type UndeliveredLogOutboxPolicy ¶
type UndeliveredLogOutboxPolicy struct {
MaxAttempts int
MaxAge time.Duration
RetryPolicy cachecore.OutboxRetryPolicy
}
UndeliveredLogOutboxPolicy stores retry/drop settings for undelivered diagnostic logs.
func BuildUndeliveredLogOutboxPolicy ¶
func BuildUndeliveredLogOutboxPolicy() UndeliveredLogOutboxPolicy
BuildUndeliveredLogOutboxPolicy returns one default undelivered-log outbox policy.
type UnsentMessageOutboxPolicy ¶
type UnsentMessageOutboxPolicy struct {
MaxAttempts int
MaxAge time.Duration
RetryPolicy cachecore.OutboxRetryPolicy
}
UnsentMessageOutboxPolicy stores retry/drop settings for unsent chat messages.
func BuildUnsentMessageOutboxPolicy ¶
func BuildUnsentMessageOutboxPolicy() UnsentMessageOutboxPolicy
BuildUnsentMessageOutboxPolicy returns one default unsent-message outbox policy.