Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2015 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 gaemiddleware provides a standard set of middleware tools for luci | 5 // Package gaeanalytics provides a standard way to store the Google Analytics |
|
estaab
2016/08/24 16:42:09
name here doesn't match actual package name
| |
| 6 // appengine apps. It's built around "github.com/julienschmidt/httprouter". | 6 // tracking ID. |
| 7 // | 7 // |
| 8 // Usage Example | 8 // Usage Example (TODO): hinoka |
|
estaab
2016/08/24 16:42:09
Is anything blocking you from doing this now? Seem
| |
| 9 // | 9 // |
| 10 // Middleware is pretty basic to use. You pick one of the 'Base' functions, | 10 // Middleware is pretty basic to use. You pick one of the 'Base' functions, |
| 11 // then layer middlewares, making the innermost middleware your actual handler | 11 // then layer middlewares, making the innermost middleware your actual handler |
| 12 // function. | 12 // function. |
| 13 // | 13 // |
| 14 // BaseProd and BaseTest ensure that the context has a full compliment of | 14 // BaseProd and BaseTest ensure that the context has a full compliment of |
| 15 // luci/gae services, as well as a luci-go/common/logging service. | 15 // luci/gae services, as well as a luci-go/common/logging service. |
| 16 // | 16 // |
| 17 // import ( | 17 // import ( |
| 18 // "log" | 18 // "log" |
| (...skipping 19 matching lines...) Expand all Loading... | |
| 38 // rw.Write([]byte("ok")) | 38 // rw.Write([]byte("ok")) |
| 39 // } | 39 // } |
| 40 // | 40 // |
| 41 // func init() { | 41 // func init() { |
| 42 // router := httprouter.New() | 42 // router := httprouter.New() |
| 43 // router.GET("/internal/make_thing/:obj_id", | 43 // router.GET("/internal/make_thing/:obj_id", |
| 44 // gaemiddleware.BaseProd(gaemiddleware.RequireCron(myHandler))) | 44 // gaemiddleware.BaseProd(gaemiddleware.RequireCron(myHandler))) |
| 45 // | 45 // |
| 46 // log.Fatal(http.ListenAndServe(":8080", router)) | 46 // log.Fatal(http.ListenAndServe(":8080", router)) |
| 47 // } | 47 // } |
| 48 package gaemiddleware | 48 package analytics |
| OLD | NEW |