| 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 coordinator | 5 package coordinator |
| 6 | 6 |
| 7 import ( | 7 import ( |
| 8 "errors" | 8 "errors" |
| 9 "fmt" | 9 "fmt" |
| 10 "time" | 10 "time" |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 63 } | 63 } |
| 64 | 64 |
| 65 func loadLogStream(p types.StreamPath, s *logdog.LogStreamState, d *logpb.LogStr
eamDescriptor) *LogStream { | 65 func loadLogStream(p types.StreamPath, s *logdog.LogStreamState, d *logpb.LogStr
eamDescriptor) *LogStream { |
| 66 ls := LogStream{ | 66 ls := LogStream{ |
| 67 Path: p, | 67 Path: p, |
| 68 Desc: d, | 68 Desc: d, |
| 69 } | 69 } |
| 70 if s != nil { | 70 if s != nil { |
| 71 st := StreamState{ | 71 st := StreamState{ |
| 72 Created: s.Created.Time(), | 72 Created: s.Created.Time(), |
| 73 Updated: s.Updated.Time(), | |
| 74 TerminalIndex: types.MessageIndex(s.TerminalIndex), | 73 TerminalIndex: types.MessageIndex(s.TerminalIndex), |
| 75 Purged: s.Purged, | 74 Purged: s.Purged, |
| 76 } | 75 } |
| 77 if a := s.Archive; a != nil { | 76 if a := s.Archive; a != nil { |
| 78 st.Archived = true | 77 st.Archived = true |
| 79 st.ArchiveIndexURL = a.IndexUrl | 78 st.ArchiveIndexURL = a.IndexUrl |
| 80 st.ArchiveStreamURL = a.StreamUrl | 79 st.ArchiveStreamURL = a.StreamUrl |
| 81 st.ArchiveDataURL = a.DataUrl | 80 st.ArchiveDataURL = a.DataUrl |
| 82 } | 81 } |
| 83 | 82 |
| (...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 174 if resp.Desc == nil { | 173 if resp.Desc == nil { |
| 175 return errors.New("Requested descriptor was not returned") | 174 return errors.New("Requested descriptor was not returned") |
| 176 } | 175 } |
| 177 if resp.State == nil { | 176 if resp.State == nil { |
| 178 return errors.New("Requested state was not returned") | 177 return errors.New("Requested state was not returned") |
| 179 } | 178 } |
| 180 ls := loadLogStream(resp.Desc.Path(), resp.State, resp.Desc) | 179 ls := loadLogStream(resp.Desc.Path(), resp.State, resp.Desc) |
| 181 *stateP = *ls | 180 *stateP = *ls |
| 182 return nil | 181 return nil |
| 183 } | 182 } |
| OLD | NEW |