Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

A draft PR for Adding a basic route Get(test/route) to test the keto performance #1128

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions internal/relationtuple/handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ type (
const (
ReadRouteBase = "/relation-tuples"
WriteRouteBase = "/admin/relation-tuples"

TestRoute = "/test/route"
)

func NewHandler(d handlerDeps) *handler {
Expand All @@ -36,6 +38,7 @@ func NewHandler(d handlerDeps) *handler {

func (h *handler) RegisterReadRoutes(r *x.ReadRouter) {
r.GET(ReadRouteBase, h.getRelations)
r.GET(TestRoute,h.basicRouteTest)
}

func (h *handler) RegisterWriteRoutes(r *x.WriteRouter) {
Expand Down
8 changes: 8 additions & 0 deletions internal/relationtuple/read_server.go
Original file line number Diff line number Diff line change
Expand Up @@ -178,3 +178,11 @@ func (h *handler) getRelations(w http.ResponseWriter, r *http.Request, _ httprou

h.d.Writer().Write(w, r, resp)
}

func (h *handler) basicRouteTest(w http.ResponseWriter, r *http.Request, ps httprouter.Params) {
l := h.d.Logger()
l.Debug("Basic Route Test")
// pprof.StopCPUProfile()
h.d.Writer().Write(w, r, "Basic Route Test")

}