11 "github.com/go-kit/kit/examples/profilesvc"
12 "github.com/go-kit/kit/log"
17 httpAddr = flag.String("http.addr", ":8080", "HTTP listen address")
23 logger = log.NewLogfmtLogger(os.Stderr)
24 logger = log.With(logger, "ts", log.DefaultTimestampUTC)
25 logger = log.With(logger, "caller", log.DefaultCaller)
28 var s profilesvc.Service
30 s = profilesvc.NewInmemService()
31 s = profilesvc.LoggingMiddleware(logger)(s)
36 h = profilesvc.MakeHTTPHandler(s, log.With(logger, "component", "HTTP"))
39 errs := make(chan error)
41 c := make(chan os.Signal)
42 signal.Notify(c, syscall.SIGINT, syscall.SIGTERM)
43 errs <- fmt.Errorf("%s", <-c)
47 logger.Log("transport", "HTTP", "addr", *httpAddr)
48 errs <- http.ListenAndServe(*httpAddr, h)
51 logger.Log("exit", <-errs)