syncstate

package
v1.3.0-rc4 Latest Latest
Warning

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

Go to latest
Published: Aug 21, 2026 License: Apache-2.0 Imports: 10 Imported by: 0

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