Documentation
¶
Index ¶
- type ResumeIdentity
- type ResumeResult
- type StorePreparingStatus
- func (s *StorePreparingStatus) Clear(ctx context.Context, orgId uuid.UUID, kind, name string) error
- func (s *StorePreparingStatus) ResumeIfCurrent(ctx context.Context, orgID uuid.UUID, kind, name string, ...) (ResumeResult, error)
- func (s *StorePreparingStatus) SetIfCurrent(ctx context.Context, orgId uuid.UUID, kind, name string, ...) error
- func (s *StorePreparingStatus) SetPreparing(ctx context.Context, prepare *model.DeltaPrepare, completed, total int) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ResumeIdentity ¶
type ResumeIdentity struct {
TemplateVersion *string
Generation *int64
SourceResourceVersion int64
}
ResumeIdentity identifies the resource state for which a delta prepare was created. The resource stores use these values directly in their conditional UPDATE predicates.
func ResumeIdentityForPrepare ¶
func ResumeIdentityForPrepare(prepare *model.DeltaPrepare) ResumeIdentity
ResumeIdentityForPrepare converts the durable prepare identity into the resource-side identity used to fence progress and resume mutations.
type ResumeResult ¶
ResumeResult reports whether the conditional resource update matched and was applied. A non-matching result means the caller must stop without emitting a completion event.
type StorePreparingStatus ¶
type StorePreparingStatus struct {
// contains filtered or unexported fields
}
StorePreparingStatus owns the Fleet and Device status mutations used by the delta worker. Keeping this as a concrete helper makes the status flow explicit without introducing a status-service interface between worker components.
func NewStorePreparingStatus ¶
func NewStorePreparingStatus(fleets fleetStatusStore, devices deviceStatusStore, loggers ...logrus.FieldLogger) *StorePreparingStatus
func (*StorePreparingStatus) ResumeIfCurrent ¶
func (s *StorePreparingStatus) ResumeIfCurrent(ctx context.Context, orgID uuid.UUID, kind, name string, identity ResumeIdentity) (ResumeResult, error)
ResumeIfCurrent performs one conditional resource update. A missing result means either the identity changed or the preparing marker was already cleared; callers must stop without retrying or emitting a follow-up event.
func (*StorePreparingStatus) SetIfCurrent ¶
func (s *StorePreparingStatus) SetIfCurrent(ctx context.Context, orgId uuid.UUID, kind, name string, identity ResumeIdentity, completed, total int) error
SetIfCurrent updates progress only when the resource still belongs to the prepare identified by identity. Resource-store CAS retries re-evaluate the identity, so a newer prepare cannot be overwritten by a stale completion.
func (*StorePreparingStatus) SetPreparing ¶
func (s *StorePreparingStatus) SetPreparing(ctx context.Context, prepare *model.DeltaPrepare, completed, total int) error
SetPreparing records the initial resource-side marker for a newly admitted prepare. The Fleet spec generation must still match validation. A newer source resource version may replace an older marker, but not vice versa.
Directories
¶
| Path | Synopsis |
|---|---|
|
Package deltageneration is a generated GoMock package.
|
Package deltageneration is a generated GoMock package. |
|
Package deltaprepare is a generated GoMock package.
|
Package deltaprepare is a generated GoMock package. |
|
Package deltapreparegeneration is a generated GoMock package.
|
Package deltapreparegeneration is a generated GoMock package. |