diff --git a/interfaces/http.go b/interfaces/http.go index 9e1facf..7c24cfa 100644 --- a/interfaces/http.go +++ b/interfaces/http.go @@ -10,6 +10,7 @@ import ( type HTTPService interface { Service GetHandler() *httprouter.Router + SetHttpHandler(handler HTTPHandler) } type HTTPHandler interface { diff --git a/service/http.go b/service/http.go index bdb090d..b5b464b 100644 --- a/service/http.go +++ b/service/http.go @@ -18,10 +18,13 @@ type HTTPImpl struct { handler interfaces.HTTPHandler } -func NewHTTP(node interfaces.Node, handler interfaces.HTTPHandler) interfaces.HTTPService { +func (h *HTTPImpl) SetHttpHandler(handler interfaces.HTTPHandler) { + h.handler = handler +} + +func NewHTTP(node interfaces.Node) interfaces.HTTPService { return &HTTPImpl{ - node: node, - handler: handler, + node: node, } }