| // Copyright 2015 The Vanadium Authors. All rights reserved. |
| // Use of this source code is governed by a BSD-style |
| // license that can be found in the LICENSE file. |
| |
| package watchable |
| |
| // GetOp represents a store get operation. |
| type GetOp struct { |
| Key []byte |
| } |
| |
| // ScanOp represents a store scan operation. |
| type ScanOp struct { |
| Start []byte |
| Limit []byte |
| } |
| |
| // PutOp represents a store put operation. The new version is written instead |
| // of the value to avoid duplicating the user data in the store. The version |
| // is used to access the user data of that specific mutation. |
| type PutOp struct { |
| Key []byte |
| Version []byte |
| } |
| |
| // DeleteOp represents a store delete operation. |
| type DeleteOp struct { |
| Key []byte |
| } |
| |
| // LogEntry represents a single store operation. This operation may have been |
| // part of a transaction, as signified by the Continued boolean. Read-only |
| // operations (and read-only transactions) are not logged. |
| type LogEntry struct { |
| // The store operation that was performed. |
| Op any |
| |
| // Time when the operation was committed in nanoseconds since the epoch. |
| // Note: We don't use time.Time here because VDL's time.Time consists of |
| // {Seconds int64, Nanos int32}, which is more expensive than a single int64. |
| CommitTimestamp int64 |
| |
| // Operation came from sync (used for echo suppression). |
| // TODO(razvanm): this field is specific to syncbase. We should add a |
| // generic way to add fields and use that instead. |
| FromSync bool |
| |
| // If true, this entry is followed by more entries that belong to the same |
| // commit as this entry. |
| Continued bool |
| } |