Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(453)

Side by Side Diff: appengine/cmd/dm/frontend/init.go

Issue 1537883002: Initial distributor implementation (Closed) Base URL: https://chromium.googlesource.com/external/github.com/luci/luci-go@master
Patch Set: work in progress Created 4 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // 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/GoogleCloudPlatform/go-endpoints/endpoints" 10 "github.com/GoogleCloudPlatform/go-endpoints/endpoints"
11 "github.com/julienschmidt/httprouter" 11 "github.com/julienschmidt/httprouter"
12 "github.com/luci/luci-go/appengine/cmd/dm/distributor"
13 "github.com/luci/luci-go/appengine/cmd/dm/distributor/impl/swarmingV1"
12 dm "github.com/luci/luci-go/appengine/cmd/dm/service" 14 dm "github.com/luci/luci-go/appengine/cmd/dm/service"
13 "github.com/luci/luci-go/appengine/tumble" 15 "github.com/luci/luci-go/appengine/tumble"
14 ) 16 )
15 17
16 var myTumble = tumble.DefaultConfig() 18 var myTumble = tumble.DefaultConfig()
17 19
18 func init() { 20 func init() {
21 reg := distributor.Registry{}
22 swarmingV1.Register(reg)
23
19 srv := endpoints.NewServer("") 24 srv := endpoints.NewServer("")
20 err := dm.RegisterEndpointsService(srv) 25 err := dm.RegisterEndpointsService(srv)
21 if err != nil { 26 if err != nil {
22 panic(err) 27 panic(err)
23 } 28 }
24 http.Handle("/_ah/spi/", srv) 29 http.Handle("/_ah/spi/", srv)
25 30
26 router := httprouter.New() 31 router := httprouter.New()
27 myTumble.InstallHandlers(router) 32 myTumble.InstallHandlers(router)
28 http.Handle("/", router) 33 http.Handle("/", router)
29 } 34 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698