fixup build

Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
This commit is contained in:
Василий Толстов 2023-05-09 21:14:55 +03:00
parent 6d1b6c7014
commit ba292901d7
3 changed files with 5 additions and 5 deletions

View File

@ -60,7 +60,7 @@ func (h *httpHandler) Options() server.HandlerOptions {
return h.opts return h.opts
} }
func (h *httpServer) HTTPHandlerFunc(handler interface{}) (http.HandlerFunc, error) { func (h *Server) HTTPHandlerFunc(handler interface{}) (http.HandlerFunc, error) {
if handler == nil { if handler == nil {
return nil, fmt.Errorf("invalid handler specified: %v", handler) return nil, fmt.Errorf("invalid handler specified: %v", handler)
} }
@ -333,7 +333,7 @@ func (h *httpServer) HTTPHandlerFunc(handler interface{}) (http.HandlerFunc, err
}, nil }, nil
} }
func (h *httpServer) ServeHTTP(w http.ResponseWriter, r *http.Request) { func (h *Server) ServeHTTP(w http.ResponseWriter, r *http.Request) {
// check for http.HandlerFunc handlers // check for http.HandlerFunc handlers
if ph, _, err := h.pathHandlers.Search(r.Method, r.URL.Path); err == nil { if ph, _, err := h.pathHandlers.Search(r.Method, r.URL.Path); err == nil {
ph.(http.HandlerFunc)(w, r) ph.(http.HandlerFunc)(w, r)

View File

@ -85,8 +85,8 @@ func Middleware(mw ...func(http.Handler) http.Handler) server.Option {
type serverKey struct{} type serverKey struct{}
// Server provide ability to pass *http.Server // HTTPServer provide ability to pass *http.Server
func Server(hs *http.Server) server.Option { func HTTPServer(hs *http.Server) server.Option {
return server.SetOption(serverKey{}, hs) return server.SetOption(serverKey{}, hs)
} }

View File

@ -101,7 +101,7 @@ func newSubscriber(topic string, sub interface{}, opts ...server.SubscriberOptio
} }
} }
func (s *httpServer) createSubHandler(sb *httpSubscriber, opts server.Options) broker.Handler { func (s *Server) createSubHandler(sb *httpSubscriber, opts server.Options) broker.Handler {
return func(p broker.Event) error { return func(p broker.Event) error {
msg := p.Message() msg := p.Message()
ct := msg.Header["Content-Type"] ct := msg.Header["Content-Type"]