0
0
Fork 0
mirror of https://github.com/go-gitea/gitea synced 2024-12-25 10:54:49 +01:00
gitea/modules
wxiaoguang 6b33152b7d
Decouple the different contexts from each other (#24786)
Replace #16455

Close #21803

Mixing different Gitea contexts together causes some problems:

1. Unable to respond proper content when error occurs, eg: Web should
respond HTML while API should respond JSON
2. Unclear dependency, eg: it's unclear when Context is used in
APIContext, which fields should be initialized, which methods are
necessary.


To make things clear, this PR introduces a Base context, it only
provides basic Req/Resp/Data features.

This PR mainly moves code. There are still many legacy problems and
TODOs in code, leave unrelated changes to future PRs.
2023-05-21 09:50:53 +08:00
..
actions
activitypub
analyze
assetfs
auth
avatar Improve avatar uploading / resizing / compressing, remove Fomantic card module (#24653) 2023-05-13 20:59:11 +02:00
base
cache
charset
container
context Decouple the different contexts from each other (#24786) 2023-05-21 09:50:53 +08:00
csv
doctor
emoji
eventsource
generate
git Add status indicator on main home screen for each repo (#24638) 2023-05-13 21:59:01 +00:00
gitgraph
graceful Implement systemd-notify protocol (#21151) 2023-05-15 22:20:30 +00:00
hcaptcha
highlight
hostmatcher
html
httpcache Use standard HTTP library to serve files (#24693) 2023-05-13 16:04:57 +02:00
httplib Use standard HTTP library to serve files (#24693) 2023-05-13 16:04:57 +02:00
indexer Some refactors for issues stats (#24793) 2023-05-19 22:17:48 +08:00
issue/template
json
label
lfs
log
markup Add RTL rendering support to Markdown (#24816) 2023-05-20 23:02:52 +02:00
mcaptcha
metrics
migration
mirror
nosql
notification
options
packages Add Go package registry (#24687) 2023-05-14 23:38:40 +08:00
paginator
pprof
private
process
proxy
proxyprotocol
public Use standard HTTP library to serve files (#24693) 2023-05-13 16:04:57 +02:00
queue Improve queue & process & stacktrace (#24636) 2023-05-11 07:45:47 +00:00
recaptcha
references
regexplru
repository Improve avatar uploading / resizing / compressing, remove Fomantic card module (#24653) 2023-05-13 20:59:11 +02:00
secret
session
setting Implement actions artifacts (#22738) 2023-05-19 21:37:57 +08:00
sitemap
ssh
storage Implement actions artifacts (#22738) 2023-05-19 21:37:57 +08:00
structs Make repo migration cancelable and fix various bugs (#24605) 2023-05-11 08:25:46 +00:00
svg
sync
system
templates
test Decouple the different contexts from each other (#24786) 2023-05-21 09:50:53 +08:00
testlogger Make testlogger output "TestLogger" prefix (#24683) 2023-05-12 14:20:29 +00:00
timeutil
translation Decouple the different contexts from each other (#24786) 2023-05-21 09:50:53 +08:00
turnstile
typesniffer
updatechecker
upload
uri
user
util Add Alpine package registry (#23714) 2023-05-12 17:27:50 +00:00
validation
web Decouple the different contexts from each other (#24786) 2023-05-21 09:50:53 +08:00
webhook