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
+2 -8
Interdiff #0 โ†’ #1
+2 -2
appview/repo/archive.go
··· 9 9 "tangled.org/core/api/tangled" 10 10 xrpcclient "tangled.org/core/appview/xrpcclient" 11 11 12 + indigoxrpc "github.com/bluesky-social/indigo/xrpc" 12 13 "github.com/go-chi/chi/v5" 13 14 "github.com/go-git/go-git/v5/plumbing" 14 - indigoxrpc "github.com/bluesky-social/indigo/xrpc" 15 15 ) 16 16 17 17 func (rp *Repo) DownloadArchive(w http.ResponseWriter, r *http.Request) { ··· 46 46 w.Header().Set("Content-Length", fmt.Sprintf("%d", len(archiveBytes))) 47 47 // Write the archive data directly 48 48 w.Write(archiveBytes) 49 - } 49 + }
-1
appview/repo/blob.go
··· 217 217 } 218 218 return slices.Contains(textualTypes, mimeType) 219 219 } 220 -
-1
appview/repo/branches.go
··· 93 93 l.Error("deleted branch from knot", "branch", branch, "repo", f.RepoAt()) 94 94 rp.pages.HxRefresh(w) 95 95 } 96 -
-1
appview/repo/compare.go
··· 212 212 }) 213 213 214 214 } 215 -
appview/repo/feed.go

This file has not been changed.

appview/repo/index.go

This file has not been changed.

-1
appview/repo/log.go
··· 221 221 DiffOpts: diffOpts, 222 222 }) 223 223 } 224 -
appview/repo/opengraph.go

This file has not been changed.

appview/repo/repo.go

This file has not been changed.

appview/repo/router.go

This file has not been changed.

appview/repo/settings.go

This file has not been changed.

-1
appview/repo/tags.go
··· 77 77 DanglingArtifacts: danglingArtifacts, 78 78 }) 79 79 } 80 -
-1
appview/repo/tree.go
··· 105 105 RepoTreeResponse: result, 106 106 }) 107 107 } 108 -

History

3 rounds 5 comments
sign up or login to add to the discussion
1 commit
expand
appview/repo: split up handlers into separate files
3/3 success
expand
expand 0 comments
pull request successfully merged
oppi.li submitted #1
1 commit
expand
appview/repo: split up handlers into separate files
3/3 success
expand
expand 0 comments
oppi.li submitted #0
1 commit
expand
appview/repo: split up handlers into separate files
1/3 failed, 2/3 timeout
expand
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.