| 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 | 9 |
| 10 "github.com/luci/luci-go/common/logdog/types" | 10 "github.com/luci/luci-go/common/logdog/types" |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 42 // Path is the stream path to retrieve. | 42 // Path is the stream path to retrieve. |
| 43 Path types.StreamPath | 43 Path types.StreamPath |
| 44 // Index is the entry's stream index. | 44 // Index is the entry's stream index. |
| 45 Index types.MessageIndex | 45 Index types.MessageIndex |
| 46 | 46 |
| 47 // Limit is the maximum number of records to return before stopping iter
ation. | 47 // Limit is the maximum number of records to return before stopping iter
ation. |
| 48 // If zero, no maximum limit will be applied. | 48 // If zero, no maximum limit will be applied. |
| 49 // | 49 // |
| 50 // The Storage instance may return fewer records than the supplied Limit
as an | 50 // The Storage instance may return fewer records than the supplied Limit
as an |
| 51 // implementation detail. | 51 // implementation detail. |
| 52 » Limit int | 52 » Limit int64 |
| 53 } | 53 } |
| 54 | 54 |
| 55 // GetCallback is invoked for each record in the Get request. If it returns | 55 // GetCallback is invoked for each record in the Get request. If it returns |
| 56 // false, iteration should stop. | 56 // false, iteration should stop. |
| 57 type GetCallback func(types.MessageIndex, []byte) bool | 57 type GetCallback func(types.MessageIndex, []byte) bool |
| 58 | 58 |
| 59 // Storage is an abstract LogDog storage implementation. Interfaces implementing | 59 // Storage is an abstract LogDog storage implementation. Interfaces implementing |
| 60 // this may be used to store and retrieve log records by the collection service | 60 // this may be used to store and retrieve log records by the collection service |
| 61 // layer. | 61 // layer. |
| 62 // | 62 // |
| (...skipping 27 matching lines...) Expand all Loading... |
| 90 | 90 |
| 91 // Tail retrieves the latest log in the stream. If the stream has no log
s, it | 91 // Tail retrieves the latest log in the stream. If the stream has no log
s, it |
| 92 // will return ErrDoesNotExist. | 92 // will return ErrDoesNotExist. |
| 93 Tail(types.StreamPath) ([]byte, types.MessageIndex, error) | 93 Tail(types.StreamPath) ([]byte, types.MessageIndex, error) |
| 94 | 94 |
| 95 // Purges a stream and all of its data from the store. | 95 // Purges a stream and all of its data from the store. |
| 96 // | 96 // |
| 97 // If the requested stream doesn't exist, ErrDoesNotExist will be return
ed. | 97 // If the requested stream doesn't exist, ErrDoesNotExist will be return
ed. |
| 98 Purge(types.StreamPath) error | 98 Purge(types.StreamPath) error |
| 99 } | 99 } |
| OLD | NEW |