Documentation
¶
Index ¶
- type Store
- type SyncStateStore
- func (s *SyncStateStore) BulkUpdateLastCheckedAt(ctx context.Context, orgID uuid.UUID, resourceKeys []string, t time.Time) error
- func (s *SyncStateStore) BulkUpsert(ctx context.Context, orgID uuid.UUID, states []model.SyncState) error
- func (s *SyncStateStore) Get(ctx context.Context, orgID uuid.UUID, resourceKey string) (*model.SyncState, error)
- func (s *SyncStateStore) InitialMigration(ctx context.Context) error
- func (s *SyncStateStore) Set(ctx context.Context, orgID uuid.UUID, state *model.SyncState) error
- func (s *SyncStateStore) SetLastCheckedAt(ctx context.Context, orgID uuid.UUID, resourceKey string, t time.Time) error
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) InitialMigration ¶
func (s *SyncStateStore) InitialMigration(ctx context.Context) error
Click to show internal directories.
Click to hide internal directories.