| // 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 nosql |
| |
| import ( |
| "v.io/v23/security/access" |
| ) |
| |
| // BatchOptions configures a batch. |
| // TODO(sadovsky): Add more options, e.g. to configure isolation, timeouts, |
| // whether to track the read set and/or write set, etc. |
| // TODO(sadovsky): Maybe add a DefaultBatchOptions() function that initializes |
| // BatchOptions with our desired defaults. Clients would be encouraged to |
| // initialize their BatchOptions object using that function and then modify it |
| // to their liking. |
| type BatchOptions struct { |
| // Arbitrary string, typically used to describe the intent behind a batch. |
| // Hints are surfaced to clients during conflict resolution. |
| Hint string |
| |
| // ReadOnly specifies whether the batch should allow writes. |
| // If ReadOnly is set to true, Abort() should be used to release any resources |
| // associated with this batch (though it is not strictly required), and |
| // Commit() will always fail. |
| ReadOnly bool |
| } |
| |
| // PrefixPermissions represents a pair of (prefix, perms). |
| type PrefixPermissions struct { |
| Prefix string |
| Perms access.Permissions |
| } |