go.chromium.org/luci@v0.0.0-20240309015107-7cdc2e660f33/milo/internal/buildsource/rawpresentation/logDogStream.go (about)

     1  // Copyright 2016 The LUCI Authors.
     2  //
     3  // Licensed under the Apache License, Version 2.0 (the "License");
     4  // you may not use this file except in compliance with the License.
     5  // You may obtain a copy of the License at
     6  //
     7  //      http://www.apache.org/licenses/LICENSE-2.0
     8  //
     9  // Unless required by applicable law or agreed to in writing, software
    10  // distributed under the License is distributed on an "AS IS" BASIS,
    11  // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    12  // See the License for the specific language governing permissions and
    13  // limitations under the License.
    14  
    15  package rawpresentation
    16  
    17  import (
    18  	annopb "go.chromium.org/luci/luciexe/legacy/annotee/proto"
    19  )
    20  
    21  // Streams represents a group of LogDog Streams with a single entry point.
    22  // Generally all of the streams are referenced by the entry point.
    23  type Streams struct {
    24  	// MainStream is a pointer to the primary stream for this group of streams.
    25  	MainStream *Stream
    26  	// Streams is the full map streamName->stream referenced by MainStream.
    27  	// It includes MainStream.
    28  	Streams map[string]*Stream
    29  }
    30  
    31  // Stream represents a single LogDog style stream, which can contain either
    32  // annotations (assumed to be annopb.Step) or text.  Other types of annotations
    33  // are not supported.
    34  type Stream struct {
    35  	// Server is the LogDog server this stream originated from.
    36  	Server string
    37  	// Prefix is the LogDog prefix for the Stream.
    38  	Prefix string
    39  	// Path is the final part of the LogDog path of the Stream.
    40  	Path string
    41  	// IsDatagram is true if this is an annopb.Step. False implies that this is a
    42  	// text log.
    43  	IsDatagram bool
    44  	// Data is the annopb.Step of the Stream, if IsDatagram is true.  Otherwise
    45  	// this is nil.
    46  	Data *annopb.Step
    47  	// Text is the text of the Stream, if IsDatagram is false.  Otherwise
    48  	// this is an empty string.
    49  	Text string
    50  
    51  	// Closed specifies whether Text or Data may change in the future.
    52  	// If Closed, they may not.
    53  	Closed bool
    54  }