getLocalStatusDoc retrieves replication status document for a given client ID from the given metadataStore
(ctx context.Context, metadataStore base.DataStore, statusKey string)
| 520 | |
| 521 | // getLocalStatusDoc retrieves replication status document for a given client ID from the given metadataStore |
| 522 | func getLocalStatusDoc(ctx context.Context, metadataStore base.DataStore, statusKey string) (*ReplicationStatusDoc, error) { |
| 523 | statusDocBytes, err := getWithTouch(metadataStore, statusKey, 0) |
| 524 | if err != nil { |
| 525 | if !base.IsDocNotFoundError(err) { |
| 526 | return nil, err |
| 527 | } |
| 528 | base.DebugfCtx(ctx, base.KeyReplicate, "couldn't find existing local checkpoint for ID %q", statusKey) |
| 529 | return nil, nil |
| 530 | } |
| 531 | var statusDoc *ReplicationStatusDoc |
| 532 | err = base.JSONUnmarshal(statusDocBytes, &statusDoc) |
| 533 | return statusDoc, err |
| 534 | } |
| 535 | |
| 536 | // getLocalStatus retrieves replication status for a given client ID from the given metadataStore |
| 537 | func getLocalStatus(ctx context.Context, metadataStore base.DataStore, statusKey string) (*ReplicationStatus, error) { |
no test coverage detected