package issue import ( "net/http" "forge.cadoles.com/wpetit/clearcase/internal/core/service" ) type Handler struct { mux *http.ServeMux issueManager *service.IssueManager } // ServeHTTP implements http.Handler. func (h *Handler) ServeHTTP(w http.ResponseWriter, r *http.Request) { h.mux.ServeHTTP(w, r) } func NewHandler(issueManager *service.IssueManager) *Handler { h := &Handler{ mux: http.NewServeMux(), issueManager: issueManager, } h.mux.HandleFunc("GET /", h.getIssuePage) h.mux.HandleFunc("PUT /", h.handleIssueSummaryForm) h.mux.HandleFunc("POST /", h.handleIssueForm) return h } var _ http.Handler = &Handler{}