| 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 frontend | 5 package frontend |
| 6 | 6 |
| 7 import ( | 7 import ( |
| 8 "net/http" | 8 "net/http" |
| 9 | 9 |
| 10 "github.com/golang/protobuf/proto" |
| 10 "golang.org/x/net/context" | 11 "golang.org/x/net/context" |
| 11 | 12 |
| 12 "github.com/golang/protobuf/proto" | |
| 13 "github.com/luci/luci-go/appengine/gaemiddleware" | 13 "github.com/luci/luci-go/appengine/gaemiddleware" |
| 14 "github.com/luci/luci-go/grpc/discovery" | 14 "github.com/luci/luci-go/grpc/discovery" |
| 15 "github.com/luci/luci-go/grpc/grpcmon" | 15 "github.com/luci/luci-go/grpc/grpcmon" |
| 16 "github.com/luci/luci-go/grpc/prpc" | 16 "github.com/luci/luci-go/grpc/prpc" |
| 17 milo "github.com/luci/luci-go/milo/api/proto" | 17 milo "github.com/luci/luci-go/milo/api/proto" |
| 18 "github.com/luci/luci-go/milo/appengine/buildbot" | 18 "github.com/luci/luci-go/milo/appengine/buildbot" |
| 19 "github.com/luci/luci-go/milo/appengine/buildbucket" | 19 "github.com/luci/luci-go/milo/appengine/buildbucket" |
| 20 "github.com/luci/luci-go/milo/appengine/buildinfo" |
| 20 "github.com/luci/luci-go/milo/appengine/console" | 21 "github.com/luci/luci-go/milo/appengine/console" |
| 21 "github.com/luci/luci-go/milo/appengine/logdog" | 22 "github.com/luci/luci-go/milo/appengine/logdog" |
| 22 "github.com/luci/luci-go/milo/appengine/settings" | 23 "github.com/luci/luci-go/milo/appengine/settings" |
| 23 "github.com/luci/luci-go/milo/appengine/swarming" | 24 "github.com/luci/luci-go/milo/appengine/swarming" |
| 24 "github.com/luci/luci-go/server/router" | 25 "github.com/luci/luci-go/server/router" |
| 25 ) | 26 ) |
| 26 | 27 |
| 27 func emptyPrelude(c context.Context, methodName string, req proto.Message) (cont
ext.Context, error) { | 28 func emptyPrelude(c context.Context, methodName string, req proto.Message) (cont
ext.Context, error) { |
| 28 return c, nil | 29 return c, nil |
| 29 } | 30 } |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 71 r.POST("/pubsub/buildbot", basemw, buildbot.PubSubHandler) | 72 r.POST("/pubsub/buildbot", basemw, buildbot.PubSubHandler) |
| 72 | 73 |
| 73 // pRPC style endpoints. | 74 // pRPC style endpoints. |
| 74 api := prpc.Server{ | 75 api := prpc.Server{ |
| 75 UnaryServerInterceptor: grpcmon.NewUnaryServerInterceptor(nil), | 76 UnaryServerInterceptor: grpcmon.NewUnaryServerInterceptor(nil), |
| 76 } | 77 } |
| 77 milo.RegisterBuildbotServer(&api, &milo.DecoratedBuildbot{ | 78 milo.RegisterBuildbotServer(&api, &milo.DecoratedBuildbot{ |
| 78 Service: &buildbot.Service{}, | 79 Service: &buildbot.Service{}, |
| 79 Prelude: emptyPrelude, | 80 Prelude: emptyPrelude, |
| 80 }) | 81 }) |
| 82 milo.RegisterBuildInfoServer(&api, &milo.DecoratedBuildInfo{ |
| 83 Service: &buildinfo.Service{}, |
| 84 Prelude: emptyPrelude, |
| 85 }) |
| 81 discovery.Enable(&api) | 86 discovery.Enable(&api) |
| 82 api.InstallHandlers(r, gaemiddleware.BaseProd()) | 87 api.InstallHandlers(r, gaemiddleware.BaseProd()) |
| 83 | 88 |
| 84 http.DefaultServeMux.Handle("/", r) | 89 http.DefaultServeMux.Handle("/", r) |
| 85 } | 90 } |
| OLD | NEW |