| @@ -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) | ||||
|   | ||||
| @@ -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) | ||||
| } | ||||
|  | ||||
|   | ||||
| @@ -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"] | ||||
|   | ||||
		Reference in New Issue
	
	Block a user