| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 package storage | 5 package storage |
| 6 | 6 |
| 7 import ( | 7 import ( |
| 8 "errors" | 8 "errors" |
| 9 "time" | 9 "time" |
| 10 | 10 |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 54 Path types.StreamPath | 54 Path types.StreamPath |
| 55 // Index is the entry's stream index. | 55 // Index is the entry's stream index. |
| 56 Index types.MessageIndex | 56 Index types.MessageIndex |
| 57 | 57 |
| 58 // Limit is the maximum number of records to return before stopping iter
ation. | 58 // Limit is the maximum number of records to return before stopping iter
ation. |
| 59 // If zero, no maximum limit will be applied. | 59 // If zero, no maximum limit will be applied. |
| 60 // | 60 // |
| 61 // The Storage instance may return fewer records than the supplied Limit
as an | 61 // The Storage instance may return fewer records than the supplied Limit
as an |
| 62 // implementation detail. | 62 // implementation detail. |
| 63 Limit int | 63 Limit int |
| 64 // KeysOnly, if true, allows (but doesn't require) the Storage instance
to |
| 65 // omit entry data in its get callback. For scanning operations, this ca
n be |
| 66 // much cheaper/faster than full data queries. |
| 67 KeysOnly bool |
| 64 } | 68 } |
| 65 | 69 |
| 66 // GetCallback is invoked for each record in the Get request. If it returns | 70 // GetCallback is invoked for each record in the Get request. If it returns |
| 67 // false, iteration should stop. | 71 // false, iteration should stop. |
| 68 type GetCallback func(types.MessageIndex, []byte) bool | 72 type GetCallback func(types.MessageIndex, []byte) bool |
| 69 | 73 |
| 70 // Storage is an abstract LogDog storage implementation. Interfaces implementing | 74 // Storage is an abstract LogDog storage implementation. Interfaces implementing |
| 71 // this may be used to store and retrieve log records by the collection service | 75 // this may be used to store and retrieve log records by the collection service |
| 72 // layer. | 76 // layer. |
| 73 // | 77 // |
| (...skipping 26 matching lines...) Expand all Loading... |
| 100 Get(GetRequest, GetCallback) error | 104 Get(GetRequest, GetCallback) error |
| 101 | 105 |
| 102 // Tail retrieves the latest log in the stream. If the stream has no log
s, it | 106 // Tail retrieves the latest log in the stream. If the stream has no log
s, it |
| 103 // will return ErrDoesNotExist. | 107 // will return ErrDoesNotExist. |
| 104 Tail(types.StreamPath) ([]byte, types.MessageIndex, error) | 108 Tail(types.StreamPath) ([]byte, types.MessageIndex, error) |
| 105 | 109 |
| 106 // Config installs the supplied configuration parameters into the storag
e | 110 // Config installs the supplied configuration parameters into the storag
e |
| 107 // instance. | 111 // instance. |
| 108 Config(Config) error | 112 Config(Config) error |
| 109 } | 113 } |
| OLD | NEW |