KeyValue is a sorted, enumerable key-value interface supporting batch mutations.
| 40 | // KeyValue is a sorted, enumerable key-value interface supporting |
| 41 | // batch mutations. |
| 42 | type KeyValue interface { |
| 43 | // Get gets the value for the given key. It returns ErrNotFound if the DB |
| 44 | // does not contain the key. |
| 45 | Get(key string) (string, error) |
| 46 | |
| 47 | Set(key, value string) error |
| 48 | |
| 49 | // Delete deletes keys. Deleting a non-existent key does not return an error. |
| 50 | Delete(key string) error |
| 51 | |
| 52 | BeginBatch() BatchMutation |
| 53 | CommitBatch(b BatchMutation) error |
| 54 | |
| 55 | // Find returns an iterator positioned before the first key/value pair |
| 56 | // whose key is 'greater than or equal to' the given key. There may be no |
| 57 | // such pair, in which case the iterator will return false on Next. |
| 58 | // |
| 59 | // The optional end value specifies the exclusive upper |
| 60 | // bound. If the empty string, the iterator returns keys |
| 61 | // where "key >= start". |
| 62 | // If non-empty, the iterator returns keys where |
| 63 | // "key >= start && key < endHint". |
| 64 | // |
| 65 | // Any error encountered will be implicitly returned via the iterator. An |
| 66 | // error-iterator will yield no key/value pairs and closing that iterator |
| 67 | // will return that error. |
| 68 | Find(start, end string) Iterator |
| 69 | |
| 70 | // Close is a polite way for the server to shut down the storage. |
| 71 | // Implementations should never lose data after a Set, Delete, |
| 72 | // or CommmitBatch, though. |
| 73 | Close() error |
| 74 | } |
| 75 | |
| 76 | // TransactionalReader is an optional interface that may be implemented by storage |
| 77 | // implementations. It may be implemented when a storage backend supports multiple |
no outgoing calls
no test coverage detected