Git with a cup of tea, painless self-hosted git service
Mirror for internal git.with.parts use
https://git.with.parts
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
wxiaoguang
b9a97ccd0e
Refactor web route ( #24080 )
...
The old code is unnecessarily complex, and has many misuses.
Old code "wraps" a lot, wrap wrap wrap, it's difficult to understand
which kind of handler is used.
The new code uses a general approach, we do not need to write all kinds
of handlers into the "wrapper", do not need to wrap them again and
again.
New code, there are only 2 concepts:
1. HandlerProvider: `func (h any) (handlerProvider func (next)
http.Handler)`, it can be used as middleware
2. Use HandlerProvider to get the final HandlerFunc, and use it for
`r.Get()`
And we can decouple the route package from context package (see the
TODO).
# FAQ
## Is `reflect` safe?
Yes, all handlers are checked during startup, see the `preCheckHandler`
comment. If any handler is wrong, developers could know it in the first
time.
## Does `reflect` affect performance?
No. https://github.com/go-gitea/gitea/pull/24080#discussion_r1164825901
1. This reflect code only runs for each web handler call, handler is far
more slower: 10ms-50ms
2. The reflect is pretty fast (comparing to other code): 0.000265ms
3. XORM has more reflect operations already
2 years ago
..
actions
Support triggering workflows by wiki related events ( #24119 )
2 years ago
activitypub
…
analyze
…
assetfs
Use a general approach to access custom/static/builtin assets ( #24022 )
2 years ago
auth
Use a general approach to access custom/static/builtin assets ( #24022 )
2 years ago
avatar
…
base
Use a general Eval function for expressions in templates. ( #23927 )
2 years ago
cache
Update redis library to support redis v7 ( #24114 )
2 years ago
charset
Refactor locale number ( #24134 )
2 years ago
container
…
context
Make HTML template functions support context ( #24056 )
2 years ago
csv
Refactor locale number ( #24134 )
2 years ago
doctor
Use a general approach to access custom/static/builtin assets ( #24022 )
2 years ago
emoji
…
eventsource
…
generate
…
git
Make wiki title supports dashes and improve wiki name related features ( #24143 )
2 years ago
gitgraph
…
graceful
Remove most path-based golangci exclusions ( #24214 )
2 years ago
hcaptcha
…
highlight
test_env: hardcode major go version in use ( #23464 )
2 years ago
hostmatcher
…
html
…
httpcache
…
httplib
Refactor internal API for git commands, use meaningful messages instead of "Internal Server Error" ( #23687 )
2 years ago
indexer
Allow adding new files to an empty repo ( #24164 )
2 years ago
issue/ template
…
json
…
label
Make label templates have consistent behavior and priority ( #23749 )
2 years ago
lfs
Make minio package support legacy MD5 checksum ( #23768 )
2 years ago
log
Remove most path-based golangci exclusions ( #24214 )
2 years ago
markup
Improve Wiki TOC ( #24137 )
2 years ago
mcaptcha
…
metrics
…
migration
…
mirror
…
nosql
Update redis library to support redis v7 ( #24114 )
2 years ago
notification
…
options
Use a general approach to access custom/static/builtin assets ( #24022 )
2 years ago
packages
Display image size for multiarch container images ( #23821 )
2 years ago
paginator
…
pprof
…
private
Fix incorrect internal response type ( #24173 )
2 years ago
process
…
proxy
…
proxyprotocol
…
public
Use a general approach to access custom/static/builtin assets ( #24022 )
2 years ago
queue
Update redis library to support redis v7 ( #24114 )
2 years ago
recaptcha
…
references
…
regexplru
…
repository
Use a general approach to access custom/static/builtin assets ( #24022 )
2 years ago
secret
…
session
Update redis library to support redis v7 ( #24114 )
2 years ago
setting
Fix incorrect CORS default values ( #24206 )
2 years ago
sitemap
…
ssh
…
storage
Make minio package support legacy MD5 checksum ( #23768 )
2 years ago
structs
Fix Org edit page bugs: renaming detection, maxlength ( #24161 )
2 years ago
svg
Use a general approach to access custom/static/builtin assets ( #24022 )
2 years ago
sync
…
system
…
templates
Make HTML template functions support context ( #24056 )
2 years ago
test
Make HTML template functions support context ( #24056 )
2 years ago
timeutil
Remove untranslatable `on_date` key ( #24106 )
2 years ago
translation
Refactor locale number ( #24134 )
2 years ago
turnstile
…
typesniffer
…
updatechecker
…
upload
…
uri
…
user
…
util
Use a general approach to access custom/static/builtin assets ( #24022 )
2 years ago
validation
…
web
Refactor web route ( #24080 )
2 years ago
webhook
…