| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 logdog | 5 package logdog |
| 6 | 6 |
| 7 // GetMessageProject implements ProjectBoundMessage. |
| 8 func (ar *RegisterStreamRequest) GetMessageProject() string { return ar.Project
} |
| 9 |
| 10 // GetMessageProject implements ProjectBoundMessage. |
| 11 func (ar *LoadStreamRequest) GetMessageProject() string { return ar.Project } |
| 12 |
| 13 // GetMessageProject implements ProjectBoundMessage. |
| 14 func (ar *TerminateStreamRequest) GetMessageProject() string { return ar.Project
} |
| 15 |
| 16 // GetMessageProject implements ProjectBoundMessage. |
| 17 func (ar *ArchiveStreamRequest) GetMessageProject() string { return ar.Project } |
| 18 |
| 7 // Complete returns true if the archive request expresses that the archived | 19 // Complete returns true if the archive request expresses that the archived |
| 8 // log stream was complete. | 20 // log stream was complete. |
| 9 // | 21 // |
| 10 // A log stream is complete if every entry between zero and its terminal index | 22 // A log stream is complete if every entry between zero and its terminal index |
| 11 // is included. | 23 // is included. |
| 12 func (ar *ArchiveStreamRequest) Complete() bool { | 24 func (ar *ArchiveStreamRequest) Complete() bool { |
| 13 tidx := ar.TerminalIndex | 25 tidx := ar.TerminalIndex |
| 14 if tidx < 0 { | 26 if tidx < 0 { |
| 15 tidx = -1 | 27 tidx = -1 |
| 16 } | 28 } |
| 17 return (ar.LogEntryCount == (tidx + 1)) | 29 return (ar.LogEntryCount == (tidx + 1)) |
| 18 } | 30 } |
| OLD | NEW |