diff --git a/go.mod b/go.mod index b2b8511..110c41c 100644 --- a/go.mod +++ b/go.mod @@ -6,6 +6,7 @@ require ( github.com/alexandrevicenzi/go-sse v1.6.0 github.com/felixge/fgprof v0.9.5 github.com/gin-gonic/gin v1.10.0 + github.com/go-chi/chi/v5 v5.1.0 github.com/go-git/go-git/v5 v5.12.0 github.com/go-playground/validator/v10 v10.22.1 github.com/go-sql-driver/mysql v1.8.1 diff --git a/go.sum b/go.sum index c6633de..ea94285 100644 --- a/go.sum +++ b/go.sum @@ -52,6 +52,8 @@ github.com/gin-gonic/gin v1.10.0 h1:nTuyha1TYqgedzytsKYqna+DfLos46nTv2ygFy86HFU= github.com/gin-gonic/gin v1.10.0/go.mod h1:4PMNQiOhvDRa013RKVbsiNwoyezlm2rm0uX/T7kzp5Y= github.com/gliderlabs/ssh v0.3.7 h1:iV3Bqi942d9huXnzEF2Mt+CY9gLu8DNM4Obd+8bODRE= github.com/gliderlabs/ssh v0.3.7/go.mod h1:zpHEXBstFnQYtGnB8k8kQLol82umzn/2/snG7alWVD8= +github.com/go-chi/chi/v5 v5.1.0 h1:acVI1TYaD+hhedDJ3r54HyA6sExp3HfXq7QWEEY/xMw= +github.com/go-chi/chi/v5 v5.1.0/go.mod h1:DslCQbL2OYiznFReuXYUmQ2hGd1aDpCnlMNITLSKoi8= github.com/go-git/gcfg v1.5.1-0.20230307220236-3a3c6141e376 h1:+zs/tPmkDkHx3U66DAb0lQFJrpS6731Oaa12ikc+DiI= github.com/go-git/gcfg v1.5.1-0.20230307220236-3a3c6141e376/go.mod h1:an3vInlBmSxCcxctByoQdvwPiA7DTK7jaaFDBTtu0ic= github.com/go-git/go-billy/v5 v5.5.0 h1:yEY4yhzCDuMGSv83oGxiBotRzhwhNr8VZyphhiu+mTU= diff --git a/integration/chi/integrate.go b/integration/chi/integrate.go new file mode 100644 index 0000000..e525c7a --- /dev/null +++ b/integration/chi/integrate.go @@ -0,0 +1,19 @@ +package chi + +import ( + "github.com/go-chi/chi/v5" + "github.com/kaz/pprotein/integration" +) + +func Integrate(r *chi.Mux) { + EnableDebugHandler(r) + EnableDebugMode(r) +} + +func EnableDebugHandler(r *chi.Mux) { + r.Handle("/debug/*", integration.NewDebugHandler()) +} + +func EnableDebugMode(r *chi.Mux) { + return +}