| OLD | NEW |
| 1 // Copyright 2015 The LUCI Authors. All rights reserved. | 1 // Copyright 2015 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 annotee | 5 package annotee |
| 6 | 6 |
| 7 import ( | 7 import ( |
| 8 "bufio" | 8 "bufio" |
| 9 "bytes" | 9 "bytes" |
| 10 "fmt" | 10 "fmt" |
| (...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 68 | 68 |
| 69 // EmitAllLink, if true, instructs an "all STDOUT/STDERR" link to be inj
ected | 69 // EmitAllLink, if true, instructs an "all STDOUT/STDERR" link to be inj
ected |
| 70 // into this Stream. | 70 // into this Stream. |
| 71 EmitAllLink bool | 71 EmitAllLink bool |
| 72 | 72 |
| 73 // BufferSize is the size of the read buffer that will be used when proc
essing | 73 // BufferSize is the size of the read buffer that will be used when proc
essing |
| 74 // this stream's data. | 74 // this stream's data. |
| 75 BufferSize int | 75 BufferSize int |
| 76 } | 76 } |
| 77 | 77 |
| 78 // LinkGenerator generates links for a given log stream. | |
| 79 type LinkGenerator interface { | |
| 80 // GetLink returns a link for the specified aggregate streams. | |
| 81 // | |
| 82 // If no link could be generated, GetLink may return an empty string. | |
| 83 GetLink(name ...types.StreamName) string | |
| 84 } | |
| 85 | |
| 86 // Options are the configuration options for a Processor. | 78 // Options are the configuration options for a Processor. |
| 87 type Options struct { | 79 type Options struct { |
| 88 // Base is the base log stream name. This is prepended to every log name
, as | 80 // Base is the base log stream name. This is prepended to every log name
, as |
| 89 // well as any generate log names. | 81 // well as any generate log names. |
| 90 Base types.StreamName | 82 Base types.StreamName |
| 91 // AnnotationSubpath is the path underneath of Base where the annotation | 83 // AnnotationSubpath is the path underneath of Base where the annotation |
| 92 // stream will be written. | 84 // stream will be written. |
| 93 // | 85 // |
| 94 // If empty, DefaultAnnotationSubpath will be used. | 86 // If empty, DefaultAnnotationSubpath will be used. |
| 95 AnnotationSubpath types.StreamName | 87 AnnotationSubpath types.StreamName |
| (...skipping 686 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 782 return "@@@" + strings.Join(append(v, params...), "@") + "@@@" | 774 return "@@@" + strings.Join(append(v, params...), "@") + "@@@" |
| 783 } | 775 } |
| 784 | 776 |
| 785 func isContentAnnotation(a string) bool { | 777 func isContentAnnotation(a string) bool { |
| 786 // Strip out any annotation arguments. | 778 // Strip out any annotation arguments. |
| 787 if idx := strings.IndexRune(a, '@'); idx > 0 { | 779 if idx := strings.IndexRune(a, '@'); idx > 0 { |
| 788 a = a[:idx] | 780 a = a[:idx] |
| 789 } | 781 } |
| 790 return a == "STEP_LOG_LINE" | 782 return a == "STEP_LOG_LINE" |
| 791 } | 783 } |
| OLD | NEW |