luci-go: github.com/luci/luci-go/milo/buildsource/rawpresentation Index | Files

package rawpresentation

import "github.com/luci/luci-go/milo/buildsource/rawpresentation"

Index

Package Files

build.go html.go logDogBuild.go logDogStream.go

Constants

const (
    // DefaultLogDogHost is the default LogDog host, if one isn't specified via
    // query string.
    DefaultLogDogHost = chromeinfra.LogDogHost
)

func AddLogDogToBuild Uses

func AddLogDogToBuild(
    c context.Context, ub URLBuilder, mainAnno *miloProto.Step, build *ui.MiloBuildLegacy)

AddLogDogToBuild takes a set of logdog streams and populate a milo build. build.Summary.Finished must be set.

func GetBuild Uses

func GetBuild(c context.Context, host string, project string, path types.StreamPath) (*ui.MiloBuildLegacy, *ui.BuildPage, error)

GetBuild returns either a MiloBuildLegacy or a Build from a raw datagram stream.

The type of return value is determined by the content type of the stream.

func InjectFakeLogdogClient Uses

func InjectFakeLogdogClient(c context.Context, client logdog.LogsClient) context.Context

InjectFakeLogdogClient adds the given logdog.LogsClient to the context.

You can obtain a fake logs client from

go.chromium.org/luci/logdog/api/endpoints/coordinator/logs/v1/fakelogs

Injecting a nil logs client will panic.

func NewClient Uses

func NewClient(c context.Context, host string) (*coordinator.Client, error)

NewClient generates a new LogDog client that issues requests on behalf of the current user.

func ReadAnnotations Uses

func ReadAnnotations(c context.Context, addr *types.StreamAddr) (*miloProto.Step, error)

ReadAnnotations synchronously reads and decodes the latest Step information from the provided StreamAddr.

func SubStepsToUI Uses

func SubStepsToUI(c context.Context, ub URLBuilder, substeps []*miloProto.Step_Substep) ([]*ui.BuildComponent, []*ui.PropertyGroup)

SubStepsToUI converts a slice of annotation substeps to ui.BuildComponent and slice of ui.PropertyGroups.

type AnnotationStream Uses

type AnnotationStream struct {
    Project string
    Path    types.StreamPath

    // Client is the HTTP client to use for LogDog communication.
    Client *coordinator.Client
    // contains filtered or unexported fields
}

AnnotationStream represents a LogDog annotation protobuf stream.

type Stream Uses

type Stream struct {
    // Server is the LogDog server this stream originated from.
    Server string
    // Prefix is the LogDog prefix for the Stream.
    Prefix string
    // Path is the final part of the LogDog path of the Stream.
    Path string
    // IsDatagram is true if this is a MiloProto. False implies that this is a text log.
    IsDatagram bool
    // Data is the miloProto.Step of the Stream, if IsDatagram is true.  Otherwise
    // this is nil.
    Data *miloProto.Step
    // Text is the text of the Stream, if IsDatagram is false.  Otherwise
    // this is an empty string.
    Text string

    // Closed specifies whether Text or Data may change in the future.
    // If Closed, they may not.
    Closed bool
}

Stream represents a single LogDog style stream, which can contain either annotations (assumed to be MiloProtos) or text. Other types of annotations are not supported.

type Streams Uses

type Streams struct {
    // MainStream is a pointer to the primary stream for this group of streams.
    MainStream *Stream
    // Streams is the full map streamName->stream referenced by MainStream.
    // It includes MainStream.
    Streams map[string]*Stream
}

Streams represents a group of LogDog Streams with a single entry point. Generally all of the streams are referenced by the entry point.

type URLBuilder Uses

type URLBuilder interface {
    // LinkURL returns the URL associated with the supplied Link.
    //
    // If no URL could be built for that Link, nil will be returned.
    BuildLink(l *miloProto.Link) *ui.Link
}

URLBuilder constructs URLs for various link types.

type ViewerURLBuilder Uses

type ViewerURLBuilder struct {
    Host    string
    Prefix  types.StreamName
    Project string
}

ViewerURLBuilder is a URL builder that constructs LogDog viewer URLs.

func NewURLBuilder Uses

func NewURLBuilder(addr *types.StreamAddr) *ViewerURLBuilder

NewURLBuilder creates a new URLBuilder that can generate links to LogDog pages given a LogDog StreamAddr.

func (b *ViewerURLBuilder) BuildLink(l *miloProto.Link) *ui.Link

BuildLink implements URLBuilder.

Package rawpresentation imports 30 packages (graph). Updated 2019-12-08. Refresh now. Tools for package owners.