Documentation
¶
Index ¶
- Variables
- func NewEnrichContextMiddleware(logger *zap.Logger) func(next http.Handler) http.Handler
- func NewLoggerMiddleware(logger *zap.Logger) func(h http.Handler) http.Handler
- func NewRecoverMiddleware(logger *zap.Logger) func(next http.Handler) http.Handler
- func NewRouter(params routesParams) *mux.Router
- type GetInfoRespData
- type GetPingRespData
- type Handlers
- type HandlersImpl
- type Server
Constants ¶
This section is empty.
Variables ¶
View Source
var Module = fx.Options( fx.Provide(NewHandlers, NewRouter, NewServer), fx.Invoke(func(lc fx.Lifecycle, shutdowner fx.Shutdowner, s *Server) { lc.Append(fx.Hook{ OnStart: func(ctx context.Context) error { go func() { _ = s.Start(shutdowner) }() return nil }, OnStop: func(ctx context.Context) error { return s.Stop(ctx) }, }) }), )
Functions ¶
func NewLoggerMiddleware ¶
func NewRecoverMiddleware ¶
Types ¶
type GetInfoRespData ¶
type GetInfoRespData struct {
Name string `json:"name"`
}
type GetPingRespData ¶
type GetPingRespData struct {
Ok bool `json:"ok"`
}
type Handlers ¶
type Handlers interface { Ping(rw http.ResponseWriter, r *http.Request) Info(rw http.ResponseWriter, r *http.Request) }
func NewHandlers ¶
func NewHandlers(params handlersParams) Handlers
type HandlersImpl ¶
type HandlersImpl struct { Logger *zap.Logger Name ecumenosfx.ServiceName }
func (*HandlersImpl) Info ¶
func (h *HandlersImpl) Info(rw http.ResponseWriter, r *http.Request)
func (*HandlersImpl) Ping ¶
func (h *HandlersImpl) Ping(rw http.ResponseWriter, r *http.Request)
Click to show internal directories.
Click to hide internal directories.