Documentation ¶
Index ¶
- func Archive(client dynamodb.PutItemAPI, syncState SyncStateRow) error
- func GetDataType() types.DataType
- func GetSyncStateExpiresAfter(timeProvider clock.TimeProvider) int64
- func UpdatePostflightDate(timeProvider clock.TimeProvider, client dynamodb.UpdateItemAPI, ...) (err error)
- func UpdateRuledownloadFinishedAt(timeProvider clock.TimeProvider, client dynamodb.UpdateItemAPI, ...) (err error)
- func UpdateRuledownloadStartedAt(timeProvider clock.TimeProvider, client dynamodb.UpdateItemAPI, ...) (err error)
- type SyncState
- type SyncStateRow
- type UpdatePostflightItem
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Archive ¶
func Archive(client dynamodb.PutItemAPI, syncState SyncStateRow) error
Archive will take the current item and duplicate it with a new sort key. This creates a unique item every time it is called, so can be used to save older copies of this row as it is mutated over time in order to preserve history.
func GetDataType ¶
func GetSyncStateExpiresAfter ¶
func GetSyncStateExpiresAfter(timeProvider clock.TimeProvider) int64
func UpdatePostflightDate ¶
func UpdatePostflightDate(timeProvider clock.TimeProvider, client dynamodb.UpdateItemAPI, machineID string) (err error)
func UpdateRuledownloadFinishedAt ¶
func UpdateRuledownloadFinishedAt(timeProvider clock.TimeProvider, client dynamodb.UpdateItemAPI, machineID string) (err error)
func UpdateRuledownloadStartedAt ¶
func UpdateRuledownloadStartedAt(timeProvider clock.TimeProvider, client dynamodb.UpdateItemAPI, machineID string) (err error)
Types ¶
type SyncState ¶
type SyncState struct { MachineID string `dynamodbav:"MachineID"` BatchSize int `dynamodbav:"BatchSize"` CleanSync bool `dynamodbav:"CleanSync"` LastCleanSync string `dynamodbav:"LastCleanSync"` FeedSyncCursor string `dynamodbav:"FeedSyncCursor"` PreflightAt string `dynamodbav:"PreflightAt"` RuledownloadStartedAt string `dynamodbav:"RuledownloadStartedAt"` RuledownloadFinishedAt string `dynamodbav:"RuledownloadFinishedAt"` PostflightAt string `dynamodbav:"PostflightAt"` ExpiresAfter int64 `dynamodbav:"ExpiresAfter,omitempty"` DataType types.DataType `dynamodbav:"DataType"` }
SyncState encapulsates data within the sync state row that's not the Primary key
type SyncStateRow ¶
type SyncStateRow struct { dynamodb.PrimaryKey SyncState }
SyncStateRow persists the sync state to the database
func CreateNewSyncState ¶
func CreateNewSyncState( timeProvider clock.TimeProvider, machineID string, requestCleanSync bool, lastCleanSync string, batchSize int, feedSyncCursor string, ) SyncStateRow
func GetByMachineID ¶
func GetByMachineID(client dynamodb.GetItemAPI, machineID string) (syncState *SyncStateRow, err error)
Returns the machine's current sync state
type UpdatePostflightItem ¶
type UpdatePostflightItem struct { PostflightAt string `dynamodbav:"PostflightAt"` FeedSyncCursor string `dynamodbav:"FeedSyncCursor"` ExpiresAfter int64 `dynamodbav:"ExpiresAfter,omitempty"` }
Update fragments
Click to show internal directories.
Click to hide internal directories.