Monorepo for Tangled tangled.org

appview/repo: split up handlers into separate files #763

merged opened by oppi.li targeting master from push-qwwtnptuywsl
Labels
refactor
assignee

None yet.

Participants 3
AT URI
at://did:plc:qfpnj4og54vl56wngdriaxug/sh.tangled.repo.pull/3m4xpanyb4r22
+1 -2
Interdiff #1 โ†’ #2
appview/repo/archive.go

This file has not been changed.

appview/repo/blob.go

This file has not been changed.

appview/repo/branches.go

This file has not been changed.

appview/repo/compare.go

This file has not been changed.

appview/repo/feed.go

This file has not been changed.

appview/repo/index.go

This file has not been changed.

appview/repo/log.go

This file has not been changed.

appview/repo/opengraph.go

This file has not been changed.

appview/repo/repo.go

This patch was likely rebased, as context lines do not match.

appview/repo/router.go

This file has not been changed.

+1 -2
appview/repo/settings.go
··· 10 10 11 11 "tangled.org/core/api/tangled" 12 12 "tangled.org/core/appview/db" 13 - "tangled.org/core/appview/models" 14 13 "tangled.org/core/appview/oauth" 15 14 "tangled.org/core/appview/pages" 16 15 xrpcclient "tangled.org/core/appview/xrpcclient" ··· 210 209 return 211 210 } 212 211 213 - defaultLabels, err := db.GetLabelDefinitions(rp.db, db.FilterIn("at_uri", models.DefaultLabelDefs())) 212 + defaultLabels, err := db.GetLabelDefinitions(rp.db, db.FilterIn("at_uri", rp.config.Label.DefaultLabelDefs)) 214 213 if err != nil { 215 214 l.Error("failed to fetch labels", "err", err) 216 215 rp.pages.Error503(w)
appview/repo/tags.go

This file has not been changed.

appview/repo/tree.go

This file has not been changed.

History

3 rounds 5 comments
sign up or login to add to the discussion
oppi.li submitted #2
1 commit
expand
appview/repo: split up handlers into separate files
expand 0 comments
pull request successfully merged
1 commit
expand
appview/repo: split up handlers into separate files
expand 0 comments
oppi.li submitted #0
1 commit
expand
appview/repo: split up handlers into separate files
expand 5 comments

I would like to add handler_ prefix for all of those files. It will make file navigation way easier. Like https://tangled.org/@hailey.at/cocoon/tree/main/server

other than that, I'm 100% supportive to this idea.

I'd prefer we didn't. Go file name convention dictates using an underscore only when needed; I believe the the "handler" bit here is implicit.

perhaps that prefix would make sense if and when we introduce the service layer that we spoke about in earlier conversations.

I don't care much about pascelCase, but I wish we name "handler" explicitly. The repo module itself is already quite ambiguous by mixed with non-handler modules like appview/db.

So we can put the handler prefix to either repo module or each files. And for this case, as the commit message says we are splitting handlers into separate files, so putting prefix for individual files make sense.

I prefer prefix rather than suffix because it makes easier to spot non-prefixed files (like routers or util files) from file explorer.