| OLD | NEW |
| 1 // Copyright 2016 The LUCI Authors. All rights reserved. | 1 // Copyright 2016 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 logdog | 5 package logdog |
| 6 | 6 |
| 7 import ( | 7 import ( |
| 8 "net/http" | 8 "net/http" |
| 9 "strings" | 9 "strings" |
| 10 | 10 |
| 11 "github.com/julienschmidt/httprouter" | |
| 12 log "github.com/luci/luci-go/common/logging" | 11 log "github.com/luci/luci-go/common/logging" |
| 13 "github.com/luci/luci-go/grpc/prpc" | 12 "github.com/luci/luci-go/grpc/prpc" |
| 14 "github.com/luci/luci-go/logdog/client/coordinator" | 13 "github.com/luci/luci-go/logdog/client/coordinator" |
| 15 "github.com/luci/luci-go/logdog/common/types" | 14 "github.com/luci/luci-go/logdog/common/types" |
| 16 "github.com/luci/luci-go/luci_config/common/cfgtypes" | 15 "github.com/luci/luci-go/luci_config/common/cfgtypes" |
| 17 "github.com/luci/luci-go/milo/appengine/settings" | 16 "github.com/luci/luci-go/milo/appengine/settings" |
| 18 "github.com/luci/luci-go/milo/common/miloerror" | 17 "github.com/luci/luci-go/milo/common/miloerror" |
| 19 "github.com/luci/luci-go/server/auth" | 18 "github.com/luci/luci-go/server/auth" |
| 20 "github.com/luci/luci-go/server/templates" | 19 "github.com/luci/luci-go/server/templates" |
| 21 | 20 |
| 21 "github.com/julienschmidt/httprouter" |
| 22 "golang.org/x/net/context" | 22 "golang.org/x/net/context" |
| 23 ) | 23 ) |
| 24 | 24 |
| 25 // AnnotationStream is a ThemedHandler that renders a LogDog Milo annotation | 25 // AnnotationStream is a ThemedHandler that renders a LogDog Milo annotation |
| 26 // protobuf stream. | 26 // protobuf stream. |
| 27 // | 27 // |
| 28 // The protobuf stream is fetched live from LogDog and cached locally, either | 28 // The protobuf stream is fetched live from LogDog and cached locally, either |
| 29 // temporarily (if incomplete) or indefinitely (if complete). | 29 // temporarily (if incomplete) or indefinitely (if complete). |
| 30 type AnnotationStream struct { | 30 type AnnotationStream struct { |
| 31 // logDogClient is a reusable HTTP client to use for LogDog. | 31 // logDogClient is a reusable HTTP client to use for LogDog. |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 70 // Load the Milo annotation protobuf from the annotation stream. | 70 // Load the Milo annotation protobuf from the annotation stream. |
| 71 if err := as.load(c); err != nil { | 71 if err := as.load(c); err != nil { |
| 72 return nil, err | 72 return nil, err |
| 73 } | 73 } |
| 74 | 74 |
| 75 // Convert the Milo Annotation protobuf to Milo objects. | 75 // Convert the Milo Annotation protobuf to Milo objects. |
| 76 return &templates.Args{ | 76 return &templates.Args{ |
| 77 "Build": as.toMiloBuild(c), | 77 "Build": as.toMiloBuild(c), |
| 78 }, nil | 78 }, nil |
| 79 } | 79 } |
| OLD | NEW |