()
| 14 | ) |
| 15 | |
| 16 | func Example_modules() { |
| 17 | c := core.New() |
| 18 | defer c.Shutdown() |
| 19 | |
| 20 | c.AddModule(srvhttp.DocsModule{}) |
| 21 | c.AddModule(srvhttp.HealthCheckModule{}) |
| 22 | c.AddModule(srvhttp.MetricsModule{}) |
| 23 | c.AddModule(srvhttp.DebugModule{}) |
| 24 | |
| 25 | router := mux.NewRouter() |
| 26 | modules := c.Modules() |
| 27 | for i := range modules { |
| 28 | if m, ok := modules[i].(core.HTTPProvider); ok { |
| 29 | m.ProvideHTTP(router) |
| 30 | } |
| 31 | } |
| 32 | http.ListenAndServe(":8080", router) |
| 33 | } |
| 34 | |
| 35 | func ExampleResponseEncoder_EncodeResponse() { |
| 36 | handler := func(writer http.ResponseWriter, request *http.Request) { |
nothing calls this directly
no test coverage detected