syncstate

package
v1.3.0-test Latest Latest
Warning

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

Go to latest
Published: Aug 2, 2026 License: Apache-2.0 Imports: 10 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 Store

type Store interface {
	InitialMigration(ctx context.Context) error
	Get(ctx context.Context, orgID uuid.UUID, resourceKey string) (*model.SyncState, error)
	Set(ctx context.Context, orgID uuid.UUID, state *model.SyncState) error
	SetLastCheckedAt(ctx context.Context, orgID uuid.UUID, resourceKey string, t time.Time) error
	BulkUpsert(ctx context.Context, orgID uuid.UUID, states []model.SyncState) error
	BulkUpdateLastCheckedAt(ctx context.Context, orgID uuid.UUID, resourceKeys []string, t time.Time) error
}

func NewSyncStateStore

func NewSyncStateStore(db *gorm.DB, log logrus.FieldLogger) Store

type SyncStateStore

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

func (*SyncStateStore) BulkUpdateLastCheckedAt

func (s *SyncStateStore) BulkUpdateLastCheckedAt(ctx context.Context, orgID uuid.UUID, resourceKeys []string, t time.Time) error

BulkUpdateLastCheckedAt updates last_checked_at for all given resource keys in a single statement. It also resets probe_status to "Synced" and clears probe_message so that transient probe failures don't persist across successful unchanged polls.

func (*SyncStateStore) BulkUpsert

func (s *SyncStateStore) BulkUpsert(ctx context.Context, orgID uuid.UUID, states []model.SyncState) error

BulkUpsert inserts or updates multiple sync state rows in a single batch.

func (*SyncStateStore) Get

func (s *SyncStateStore) Get(ctx context.Context, orgID uuid.UUID, resourceKey string) (*model.SyncState, error)

func (*SyncStateStore) InitialMigration

func (s *SyncStateStore) InitialMigration(ctx context.Context) error

func (*SyncStateStore) Set

func (s *SyncStateStore) Set(ctx context.Context, orgID uuid.UUID, state *model.SyncState) error

func (*SyncStateStore) SetLastCheckedAt

func (s *SyncStateStore) SetLastCheckedAt(ctx context.Context, orgID uuid.UUID, resourceKey string, t time.Time) error

Jump to

Keyboard shortcuts

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