service

package
v1.4.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 23, 2026 License: Apache-2.0 Imports: 12 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

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

type ResumeResult struct {
	Matched bool
	Fleet   *domain.Fleet
}

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) Clear

func (s *StorePreparingStatus) Clear(ctx context.Context, orgId uuid.UUID, kind, name string) error

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL