Documentation
¶
Index ¶
- Constants
- Variables
- func ForkOperationPlanAuthorityThreadIDs(plan ForkOperationPlan) []string
- func ForkOperationPlanNodes(plan ForkOperationPlan) []sessiontree.ForkOptions
- func ForkOperationPlanSourceThreadIDs(plan ForkOperationPlan) []string
- func ValidateForkOperationCommitNodes(plan ForkOperationPlan, nodes []sessiontree.ForkOptions) error
- func ValidateForkOperationPlan(plan ForkOperationPlan, operationID, fingerprint string) error
- func ValidateForkOperationRecord(rec ForkOperationRecord) error
- func ValidatePreparedForkOperation(rec ForkOperationRecord) error
- type ForkOperationCommitRequest
- type ForkOperationFailureRequest
- type ForkOperationPlan
- type ForkOperationPlanNode
- type ForkOperationRecord
- type ForkOperationState
- type ForkOperationStore
- type MemoryForkOperationStore
- func (s *MemoryForkOperationStore) CommitForkOperation(ctx context.Context, req ForkOperationCommitRequest) (ForkOperationRecord, bool, error)
- func (s *MemoryForkOperationStore) FailForkOperation(ctx context.Context, req ForkOperationFailureRequest) (ForkOperationRecord, bool, error)
- func (s *MemoryForkOperationStore) ForkOperation(_ context.Context, operationID string) (ForkOperationRecord, error)
- func (s *MemoryForkOperationStore) PrepareForkOperation(ctx context.Context, rec ForkOperationRecord) (ForkOperationRecord, bool, error)
- type MetadataRecord
- type MetadataStore
- type Store
- type StoreLeasePolicyMismatchError
- type StoreSchemaIdentity
- type StoreSchemaMigrationRequirement
- type StoreSchemaMigrationSource
- type UnsupportedStoreSchemaError
Constants ¶
View Source
const ForkOperationPlanVersion = 5
Variables ¶
View Source
var ( ErrForkOperationNotFound = errors.New("fork operation not found") ErrForkOperationConflict = errors.New("fork operation conflicts with existing record") )
View Source
var ErrMetadataNotFound = errors.New("storage metadata not found")
Functions ¶
func ForkOperationPlanAuthorityThreadIDs ¶ added in v0.18.0
func ForkOperationPlanAuthorityThreadIDs(plan ForkOperationPlan) []string
func ForkOperationPlanNodes ¶ added in v0.18.0
func ForkOperationPlanNodes(plan ForkOperationPlan) []sessiontree.ForkOptions
func ForkOperationPlanSourceThreadIDs ¶ added in v0.18.0
func ForkOperationPlanSourceThreadIDs(plan ForkOperationPlan) []string
func ValidateForkOperationCommitNodes ¶ added in v0.18.0
func ValidateForkOperationCommitNodes(plan ForkOperationPlan, nodes []sessiontree.ForkOptions) error
func ValidateForkOperationPlan ¶ added in v0.18.0
func ValidateForkOperationPlan(plan ForkOperationPlan, operationID, fingerprint string) error
func ValidateForkOperationRecord ¶ added in v0.5.0
func ValidateForkOperationRecord(rec ForkOperationRecord) error
func ValidatePreparedForkOperation ¶ added in v0.5.0
func ValidatePreparedForkOperation(rec ForkOperationRecord) error
Types ¶
type ForkOperationCommitRequest ¶ added in v0.18.0
type ForkOperationCommitRequest struct {
OperationID string
RequestFingerprint string
Plan json.RawMessage
Nodes []sessiontree.ForkOptions
Result json.RawMessage
FinishedAt time.Time
}
type ForkOperationFailureRequest ¶ added in v0.18.0
type ForkOperationPlan ¶ added in v0.18.0
type ForkOperationPlan struct {
Version int `json:"version"`
OperationID string `json:"operation_id"`
RequestFingerprint string `json:"request_fingerprint"`
PreparedAt time.Time `json:"prepared_at"`
Root ForkOperationPlanNode `json:"root"`
TerminalChildren []ForkOperationPlanNode `json:"terminal_children,omitempty"`
}
func DecodeForkOperationPlan ¶ added in v0.18.0
func DecodeForkOperationPlan(data json.RawMessage) (ForkOperationPlan, error)
type ForkOperationPlanNode ¶ added in v0.18.0
type ForkOperationPlanNode struct {
NodeID string `json:"node_id"`
SourceThreadID string `json:"source_thread_id"`
SourceEntryID string `json:"source_entry_id,omitempty"`
SourceLeafEntryID string `json:"source_leaf_entry_id,omitempty"`
DestinationThreadID string `json:"destination_thread_id"`
TurnIDMap map[string]string `json:"turn_id_map,omitempty"`
RunIDMap map[string]string `json:"run_id_map,omitempty"`
DestinationMeta *sessiontree.ForkDestinationMeta `json:"destination_meta,omitempty"`
ArtifactClosure artifact.Closure `json:"artifact_closure"`
}
type ForkOperationRecord ¶ added in v0.5.0
type ForkOperationRecord struct {
OperationID string
RequestFingerprint string
SourceThreadIDs []string
AuthorityThreadIDs []string
State ForkOperationState
Plan json.RawMessage
Result json.RawMessage
ErrorCode string
ErrorMessage string
CreatedAt time.Time
UpdatedAt time.Time
FinishedAt time.Time
}
type ForkOperationState ¶ added in v0.5.0
type ForkOperationState string
const ( ForkOperationPrepared ForkOperationState = "prepared" ForkOperationCompleted ForkOperationState = "completed" ForkOperationFailed ForkOperationState = "failed" )
func (ForkOperationState) Valid ¶ added in v0.5.0
func (s ForkOperationState) Valid() bool
type ForkOperationStore ¶ added in v0.5.0
type ForkOperationStore interface {
PrepareForkOperation(context.Context, ForkOperationRecord) (ForkOperationRecord, bool, error)
ForkOperation(context.Context, string) (ForkOperationRecord, error)
CommitForkOperation(context.Context, ForkOperationCommitRequest) (ForkOperationRecord, bool, error)
FailForkOperation(context.Context, ForkOperationFailureRequest) (ForkOperationRecord, bool, error)
}
type MemoryForkOperationStore ¶ added in v0.5.0
type MemoryForkOperationStore struct {
// contains filtered or unexported fields
}
func NewMemoryForkOperationStore ¶ added in v0.5.0
func NewMemoryForkOperationStore(authority *sessiontree.MemoryRepo) *MemoryForkOperationStore
func (*MemoryForkOperationStore) CommitForkOperation ¶ added in v0.18.0
func (s *MemoryForkOperationStore) CommitForkOperation(ctx context.Context, req ForkOperationCommitRequest) (ForkOperationRecord, bool, error)
func (*MemoryForkOperationStore) FailForkOperation ¶ added in v0.18.0
func (s *MemoryForkOperationStore) FailForkOperation(ctx context.Context, req ForkOperationFailureRequest) (ForkOperationRecord, bool, error)
func (*MemoryForkOperationStore) ForkOperation ¶ added in v0.5.0
func (s *MemoryForkOperationStore) ForkOperation(_ context.Context, operationID string) (ForkOperationRecord, error)
func (*MemoryForkOperationStore) PrepareForkOperation ¶ added in v0.5.0
func (s *MemoryForkOperationStore) PrepareForkOperation(ctx context.Context, rec ForkOperationRecord) (ForkOperationRecord, bool, error)
type MetadataRecord ¶
type MetadataStore ¶
type Store ¶
type Store interface {
sessiontree.Repo
cache.Store
MetadataStore
ForkOperationStore
sessiontree.ProviderStateStore
Close() error
}
type StoreLeasePolicyMismatchError ¶ added in v0.18.0
type StoreLeasePolicyMismatchError struct {
Configured sessiontree.LeasePolicy
Persisted sessiontree.LeasePolicy
}
func (*StoreLeasePolicyMismatchError) Error ¶ added in v0.18.0
func (e *StoreLeasePolicyMismatchError) Error() string
type StoreSchemaIdentity ¶ added in v0.26.0
type StoreSchemaMigrationRequirement ¶ added in v0.26.0
type StoreSchemaMigrationRequirement string
const ( StoreSchemaMigrationRequirementNone StoreSchemaMigrationRequirement = "none" StoreSchemaMigrationRequirementQuiescentAuthority StoreSchemaMigrationRequirement = "quiescent_authority" )
type StoreSchemaMigrationSource ¶ added in v0.26.0
type StoreSchemaMigrationSource struct {
Identity StoreSchemaIdentity
Requirement StoreSchemaMigrationRequirement
}
type UnsupportedStoreSchemaError ¶ added in v0.18.0
type UnsupportedStoreSchemaError struct {
Observed StoreSchemaIdentity
Current StoreSchemaIdentity
Migratable []StoreSchemaMigrationSource
}
UnsupportedStoreSchemaError reports an exact schema contract mismatch. Store open must return this error without modifying the observed database.
func (*UnsupportedStoreSchemaError) Error ¶ added in v0.18.0
func (e *UnsupportedStoreSchemaError) Error() string
Click to show internal directories.
Click to hide internal directories.