ChangeVersionString returns the first version string we found in the ChangeEntry.
(ctx context.Context)
| 66 | |
| 67 | // ChangeVersionString returns the first version string we found in the ChangeEntry. |
| 68 | func (ce *ChangeEntry) ChangeVersionString(ctx context.Context) string { |
| 69 | if len(ce.Changes) == 0 { |
| 70 | base.AssertfCtx(ctx, "ChangesEntry has no changes: %s", ce.String()) |
| 71 | return "" |
| 72 | } |
| 73 | // pick just the first entry in changes |
| 74 | for _, changeVersionString := range ce.Changes[0] { |
| 75 | // whichever version is present we'll return it - only expected to have one version type populated - since the feed is initialized with a preferred version type. |
| 76 | return changeVersionString |
| 77 | } |
| 78 | return "" |
| 79 | } |
| 80 | |
| 81 | // A changes entry; Database.GetChanges returns an array of these. |
| 82 | // Marshals into the standard CouchDB _changes format. |
no test coverage detected