restore

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Apr 13, 2026 License: Apache-2.0 Imports: 11 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

func PrepareDevices

func PrepareDevices(ctx context.Context, rs *RestoreStore, kv kvstore.KVStore, log logrus.FieldLogger) (devicesUpdated int64, err error)

PrepareDevices performs post-restoration device preparation: clear KV store, update device and enrollment request annotations, add awaiting-reconnection keys, and create a system restored event in the store.

Types

type RestoreStore

type RestoreStore struct {
	// contains filtered or unexported fields
}

RestoreStore provides the minimal set of database operations required by the post-restoration preparation logic. It wraps a *gorm.DB directly so the restore package does not depend on internal/store.Store.

func NewRestoreStore

func NewRestoreStore(db *gorm.DB) *RestoreStore

NewRestoreStore creates a RestoreStore backed by the given gorm connection.

func (*RestoreStore) CreateEvent

func (s *RestoreStore) CreateEvent(ctx context.Context, orgId uuid.UUID, resource *domain.Event) error

CreateEvent persists a domain event.

func (*RestoreStore) GetAllDeviceNames

func (s *RestoreStore) GetAllDeviceNames(ctx context.Context, orgId uuid.UUID) ([]string, error)

GetAllDeviceNames returns all device names for a given organization.

func (*RestoreStore) ListOrganizations

func (s *RestoreStore) ListOrganizations(ctx context.Context) ([]*orgmodel.Organization, error)

ListOrganizations returns all organizations (no filtering).

func (*RestoreStore) PrepareDevicesAfterRestore

func (s *RestoreStore) PrepareDevicesAfterRestore(ctx context.Context) (int64, error)

PrepareDevicesAfterRestore sets the awaitingReconnect annotation on all eligible devices, clears their lastSeen timestamps, and sets a status summary.

func (*RestoreStore) PrepareEnrollmentRequestsAfterRestore

func (s *RestoreStore) PrepareEnrollmentRequestsAfterRestore(ctx context.Context) (int64, error)

PrepareEnrollmentRequestsAfterRestore sets the awaitingReconnect annotation on all non-approved enrollment requests.

Jump to

Keyboard shortcuts

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