Documentation
¶
Overview ¶
Package storage provides opaque storage values for ordinary Floret hosts. Transactional backend implementation belongs to the advanced storage/spi package and cannot be used to query a runtime-owned Source.
Index ¶
- Variables
- type MigrationSchemaError
- type Source
- type UnsupportedLegacyContentError
- type V2MigrationApplyRequest
- type V2MigrationPlan
- func (plan V2MigrationPlan) CoordinatorCommitment() string
- func (plan V2MigrationPlan) EntryCount() int
- func (plan V2MigrationPlan) MarshalJSON() ([]byte, error)
- func (plan V2MigrationPlan) OperationID() string
- func (plan V2MigrationPlan) PlanHash() string
- func (plan V2MigrationPlan) SourceSemanticHash() string
- func (plan V2MigrationPlan) TargetSemanticHash() string
- func (plan V2MigrationPlan) ThreadCount() int
- func (plan *V2MigrationPlan) UnmarshalJSON(data []byte) error
- type V2MigrationPreflightRequest
- type V2MigrationPreview
- type V2MigrationPreviewRequest
- type V2MigrationReceipt
Constants ¶
This section is empty.
Variables ¶
var ( // ErrMigrationConflict reports that the source, immutable plan, or committed // target no longer describes the same migration operation. ErrMigrationConflict = errors.New("floret v2 to v3 migration conflict") )
Functions ¶
This section is empty.
Types ¶
type MigrationSchemaError ¶
MigrationSchemaError reports a database outside the exact supported v2.2 source schema or exact v3 migration receipt.
func (*MigrationSchemaError) Error ¶
func (failure *MigrationSchemaError) Error() string
Error describes the rejected migration schema.
type Source ¶
type Source storagebridge.Source
Source is an opaque storage configuration consumed exclusively by runtime.Open. It deliberately has no exported methods.
func Memory ¶
func Memory() Source
Memory returns an in-memory Source suitable for production ephemeral use and deterministic tests.
type UnsupportedLegacyContentError ¶
type UnsupportedLegacyContentError struct {
Kind string `json:"kind"`
Count int `json:"count"`
Reason string `json:"reason"`
}
UnsupportedLegacyContentError reports valid legacy content for which the frozen conversion table has no unique v3 representation.
func (*UnsupportedLegacyContentError) Error ¶
func (failure *UnsupportedLegacyContentError) Error() string
type V2MigrationApplyRequest ¶
type V2MigrationApplyRequest struct {
Path string
Plan V2MigrationPlan
}
type V2MigrationPlan ¶
type V2MigrationPlan struct {
// contains filtered or unexported fields
}
V2MigrationPlan is a content-addressed, immutable migration plan. Its fields are intentionally private so callers cannot construct an unchecked plan. Strict JSON round-tripping is supported for offline coordination.
func PreflightV2Migration ¶
func PreflightV2Migration(ctx context.Context, request V2MigrationPreflightRequest) (V2MigrationPlan, error)
PreflightV2Migration verifies representability and returns an immutable, content-addressed plan without mutating the source.
func (V2MigrationPlan) CoordinatorCommitment ¶
func (plan V2MigrationPlan) CoordinatorCommitment() string
func (V2MigrationPlan) EntryCount ¶
func (plan V2MigrationPlan) EntryCount() int
func (V2MigrationPlan) MarshalJSON ¶
func (plan V2MigrationPlan) MarshalJSON() ([]byte, error)
func (V2MigrationPlan) OperationID ¶
func (plan V2MigrationPlan) OperationID() string
func (V2MigrationPlan) PlanHash ¶
func (plan V2MigrationPlan) PlanHash() string
func (V2MigrationPlan) SourceSemanticHash ¶
func (plan V2MigrationPlan) SourceSemanticHash() string
func (V2MigrationPlan) TargetSemanticHash ¶
func (plan V2MigrationPlan) TargetSemanticHash() string
func (V2MigrationPlan) ThreadCount ¶
func (plan V2MigrationPlan) ThreadCount() int
func (*V2MigrationPlan) UnmarshalJSON ¶
func (plan *V2MigrationPlan) UnmarshalJSON(data []byte) error
type V2MigrationPreflightRequest ¶
type V2MigrationPreflightRequest struct {
Path string
OperationID string
CoordinatorCommitment string
}
V2MigrationPreflightRequest identifies a read-only representability check. CoordinatorCommitment is opaque to Floret and binds a product-level joint upgrade journal to the resulting immutable plan.
type V2MigrationPreview ¶
type V2MigrationPreview struct {
PlanHash string `json:"plan_hash"`
SourceSemanticHash string `json:"source_semantic_hash"`
TargetSemanticHash string `json:"target_semantic_hash"`
Threads int `json:"threads"`
Entries int `json:"entries"`
}
func PreviewV2Migration ¶
func PreviewV2Migration(ctx context.Context, request V2MigrationPreviewRequest) (V2MigrationPreview, error)
PreviewV2Migration verifies that the source still matches plan and returns the exact target semantic summary without writing.
type V2MigrationPreviewRequest ¶
type V2MigrationPreviewRequest struct {
Path string
Plan V2MigrationPlan
}
type V2MigrationReceipt ¶
type V2MigrationReceipt struct {
OperationID string `json:"operation_id"`
Replayed bool `json:"replayed"`
PlanHash string `json:"plan_hash"`
SourceSemanticHash string `json:"source_semantic_hash"`
TargetSemanticHash string `json:"target_semantic_hash"`
CoordinatorCommitment string `json:"coordinator_commitment"`
Threads int `json:"threads"`
Entries int `json:"entries"`
}
V2MigrationReceipt proves the exact source, target, plan, and opaque coordinator commitment that were committed atomically by Floret.
func ApplyV2Migration ¶
func ApplyV2Migration(ctx context.Context, request V2MigrationApplyRequest) (result V2MigrationReceipt, resultErr error)
ApplyV2Migration atomically applies an unchanged immutable plan. Exact replays return the original receipt; any source, plan, or target drift is a permanent migration conflict.