| OLD | NEW |
| 1 /* | 1 /* |
| 2 Copyright 2016 The LUCI Authors. All rights reserved. | 2 Copyright 2016 The LUCI Authors. All rights reserved. |
| 3 Use of this source code is governed under the Apache License, Version 2.0 | 3 Use of this source code is governed under the Apache License, Version 2.0 |
| 4 that can be found in the LICENSE file. | 4 that can be found in the LICENSE file. |
| 5 */ | 5 */ |
| 6 | 6 |
| 7 namespace LogDog { | 7 namespace LogDog { |
| 8 | 8 |
| 9 /** Log stream type RPC protobuf enumeration. */ | 9 /** Log stream type RPC protobuf enumeration. */ |
| 10 export enum StreamType { | 10 export enum StreamType { |
| 11 TEXT, | 11 TEXT, |
| 12 BINARY, | 12 BINARY, |
| 13 DATAGRAM, | 13 DATAGRAM, |
| 14 } | 14 } |
| 15 | 15 |
| 16 /** Locally-typed LogStreamDescriptor RPC protobuf object class. */ | 16 /** Locally-typed LogStreamDescriptor RPC protobuf object class. */ |
| 17 export class LogStreamDescriptor { | 17 export class LogStreamDescriptor { |
| 18 readonly name: string; | 18 readonly name: string; |
| 19 readonly timestamp: Date; | 19 readonly timestamp: Date; |
| 20 readonly tags: {[key: string]: string}; |
| 20 | 21 |
| 21 static make(desc: any): LogStreamDescriptor { | 22 static make(desc: any): LogStreamDescriptor { |
| 22 desc.timestamp = new Date(desc.timestamp); | 23 desc.timestamp = new Date(desc.timestamp); |
| 23 return desc; | 24 return desc; |
| 24 } | 25 } |
| 25 } | 26 } |
| 26 | 27 |
| 27 /** Locally-typed LogStreamState RPC protobuf object class. */ | 28 /** Locally-typed LogStreamState RPC protobuf object class. */ |
| 28 export class LogStreamState { | 29 export class LogStreamState { |
| 29 created: Date; | 30 created: Date; |
| (...skipping 210 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 240 * @param d The base Date object. | 241 * @param d The base Date object. |
| 241 * @param ms The number of milliseconds to add. | 242 * @param ms The number of milliseconds to add. |
| 242 * @return a date that is "ms" milliseconds added to "d". | 243 * @return a date that is "ms" milliseconds added to "d". |
| 243 */ | 244 */ |
| 244 function addMillisecondsToDate(d: Date, ms: number) { | 245 function addMillisecondsToDate(d: Date, ms: number) { |
| 245 d = new Date(d); | 246 d = new Date(d); |
| 246 d.setMilliseconds(d.getMilliseconds() + ms); | 247 d.setMilliseconds(d.getMilliseconds() + ms); |
| 247 return d; | 248 return d; |
| 248 } | 249 } |
| 249 } | 250 } |
| OLD | NEW |