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 streamproto | 5 package streamproto |
6 | 6 |
7 import ( | 7 import ( |
8 "time" | 8 "time" |
9 | 9 |
10 "github.com/luci/luci-go/common/clock/clockflag" | 10 "github.com/luci/luci-go/common/clock/clockflag" |
(...skipping 23 matching lines...) Expand all Loading... |
34 // | 34 // |
35 // Note that this value is best-effort, as it is subject to the constrai
nts | 35 // Note that this value is best-effort, as it is subject to the constrai
nts |
36 // of the underlying transport medium. | 36 // of the underlying transport medium. |
37 Deadline time.Duration | 37 Deadline time.Duration |
38 } | 38 } |
39 | 39 |
40 // Validate validates that the configured Properties are valid and sufficient to | 40 // Validate validates that the configured Properties are valid and sufficient to |
41 // create a Butler stream. | 41 // create a Butler stream. |
42 // | 42 // |
43 // It skips stream Prefix validation and instead asserts that it is empty, as | 43 // It skips stream Prefix validation and instead asserts that it is empty, as |
44 // it should not be populatated when Properties are defined. | 44 // it should not be populated when Properties are defined. |
45 func (p *Properties) Validate() error { | 45 func (p *Properties) Validate() error { |
46 if err := p.LogStreamDescriptor.Validate(false); err != nil { | 46 if err := p.LogStreamDescriptor.Validate(false); err != nil { |
47 return err | 47 return err |
48 } | 48 } |
49 return nil | 49 return nil |
50 } | 50 } |
51 | 51 |
52 // Flags is a flag- and JSON-compatible collapse of Properties. It is used | 52 // Flags is a flag- and JSON-compatible collapse of Properties. It is used |
53 // for stream negotiation protocol and command-line interfaces. | 53 // for stream negotiation protocol and command-line interfaces. |
54 type Flags struct { | 54 type Flags struct { |
(...skipping 26 matching lines...) Expand all Loading... |
81 Timestamp: google.NewTimestamp(time.Time(f.Timestamp
)), | 81 Timestamp: google.NewTimestamp(time.Time(f.Timestamp
)), |
82 BinaryFileExt: f.BinaryFileExtension, | 82 BinaryFileExt: f.BinaryFileExtension, |
83 Tags: f.Tags, | 83 Tags: f.Tags, |
84 }, | 84 }, |
85 Tee: f.Tee, | 85 Tee: f.Tee, |
86 Timeout: time.Duration(f.Timeout), | 86 Timeout: time.Duration(f.Timeout), |
87 Deadline: time.Duration(f.Deadline), | 87 Deadline: time.Duration(f.Deadline), |
88 } | 88 } |
89 return p | 89 return p |
90 } | 90 } |
OLD | NEW |