| OLD | NEW |
| 1 // Copyright 2016 The LUCI Authors. All rights reserved. | 1 // Copyright 2016 The LUCI Authors. All rights reserved. |
| 2 // Use of this source code is governed under the Apache License, Version 2.0 | 2 // Use of this source code is governed under the Apache License, Version 2.0 |
| 3 // that can be found in the LICENSE file. | 3 // that can be found in the LICENSE file. |
| 4 | 4 |
| 5 package archivist | 5 package archivist |
| 6 | 6 |
| 7 import ( | 7 import ( |
| 8 "io" | 8 "io" |
| 9 | 9 |
| 10 log "github.com/luci/luci-go/common/logging" | 10 log "github.com/luci/luci-go/common/logging" |
| 11 "github.com/luci/luci-go/logdog/api/logpb" | 11 "github.com/luci/luci-go/logdog/api/logpb" |
| 12 "github.com/luci/luci-go/logdog/common/storage" | 12 "github.com/luci/luci-go/logdog/common/storage" |
| 13 "github.com/luci/luci-go/logdog/common/types" | 13 "github.com/luci/luci-go/logdog/common/types" |
| 14 "github.com/luci/luci-go/luci_config/common/cfgtypes" | 14 "github.com/luci/luci-go/luci_config/common/cfgtypes" |
| 15 |
| 15 "golang.org/x/net/context" | 16 "golang.org/x/net/context" |
| 16 ) | 17 ) |
| 17 | 18 |
| 18 // storageSource is a renderer.Source that pulls log entries from intermediate | 19 // storageSource is a renderer.Source that pulls log entries from intermediate |
| 19 // storage via its storage.Storage instance. | 20 // storage via its storage.Storage instance. |
| 20 type storageSource struct { | 21 type storageSource struct { |
| 21 context.Context | 22 context.Context |
| 22 | 23 |
| 23 st storage.Storage // the storage instance to read from | 24 st storage.Storage // the storage instance to read from |
| 24 project cfgtypes.ProjectName // the path of the log stream | 25 project cfgtypes.ProjectName // the path of the log stream |
| (...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 96 "index": sidx, | 97 "index": sidx, |
| 97 "terminalIndex": s.terminalIndex, | 98 "terminalIndex": s.terminalIndex, |
| 98 }.Warningf(s, "Discarding log entries beyond expected terminal i
ndex.") | 99 }.Warningf(s, "Discarding log entries beyond expected terminal i
ndex.") |
| 99 return nil, io.EOF | 100 return nil, io.EOF |
| 100 } | 101 } |
| 101 | 102 |
| 102 s.lastIndex = sidx | 103 s.lastIndex = sidx |
| 103 s.logEntryCount++ | 104 s.logEntryCount++ |
| 104 return le, nil | 105 return le, nil |
| 105 } | 106 } |
| OLD | NEW |