diff --git a/handler.go b/handler.go index 5657440..60dc74f 100644 --- a/handler.go +++ b/handler.go @@ -60,7 +60,7 @@ func (h *httpHandler) Options() server.HandlerOptions { return h.opts } -func (h *httpServer) HTTPHandlerFunc(handler interface{}) (http.HandlerFunc, error) { +func (h *Server) HTTPHandlerFunc(handler interface{}) (http.HandlerFunc, error) { if handler == nil { return nil, fmt.Errorf("invalid handler specified: %v", handler) } @@ -333,7 +333,7 @@ func (h *httpServer) HTTPHandlerFunc(handler interface{}) (http.HandlerFunc, err }, 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 if ph, _, err := h.pathHandlers.Search(r.Method, r.URL.Path); err == nil { ph.(http.HandlerFunc)(w, r) diff --git a/options.go b/options.go index 3825d11..b3d5518 100644 --- a/options.go +++ b/options.go @@ -85,8 +85,8 @@ func Middleware(mw ...func(http.Handler) http.Handler) server.Option { type serverKey struct{} -// Server provide ability to pass *http.Server -func Server(hs *http.Server) server.Option { +// HTTPServer provide ability to pass *http.Server +func HTTPServer(hs *http.Server) server.Option { return server.SetOption(serverKey{}, hs) } diff --git a/subscriber.go b/subscriber.go index 974ec06..89c6ba9 100644 --- a/subscriber.go +++ b/subscriber.go @@ -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 { msg := p.Message() ct := msg.Header["Content-Type"]