You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
forgejo/cmd
Lunny Xiao c53ad052d8
Refactor the setting to make unit test easier (#22405)
Some bugs caused by less unit tests in fundamental packages. This PR
refactor `setting` package so that create a unit test will be easier
than before.

- All `LoadFromXXX` files has been splited as two functions, one is
`InitProviderFromXXX` and `LoadCommonSettings`. The first functions will
only include the code to create or new a ini file. The second function
will load common settings.
- It also renames all functions in setting from `newXXXService` to
`loadXXXSetting` or `loadXXXFrom` to make the function name less
confusing.
- Move `XORMLog` to `SQLLog` because it's a better name for that.

Maybe we should finally move these `loadXXXSetting` into the `XXXInit`
function? Any idea?

---------

Co-authored-by: 6543 <6543@obermui.de>
Co-authored-by: delvh <dev.lh@web.de>
1 year ago
..
admin.go Add command to bulk set must-change-password (#22823) 1 year ago
admin_auth_ldap.go Implement FSFE REUSE for golang files (#21840) 1 year ago
admin_auth_ldap_test.go Implement FSFE REUSE for golang files (#21840) 1 year ago
admin_user.go Add command to bulk set must-change-password (#22823) 1 year ago
admin_user_change_password.go Provide the ability to set password hash algorithm parameters (#22942) 1 year ago
admin_user_create.go Provide the ability to set password hash algorithm parameters (#22942) 1 year ago
admin_user_delete.go Add context cache as a request level cache (#22294) 1 year ago
admin_user_generate_access_token.go Add command to bulk set must-change-password (#22823) 1 year ago
admin_user_list.go Add command to bulk set must-change-password (#22823) 1 year ago
admin_user_must_change_password.go Add command to bulk set must-change-password (#22823) 1 year ago
cert.go Implement FSFE REUSE for golang files (#21840) 1 year ago
cmd.go Refactor the setting to make unit test easier (#22405) 1 year ago
convert.go Refactor the setting to make unit test easier (#22405) 1 year ago
docs.go Implement FSFE REUSE for golang files (#21840) 1 year ago
doctor.go Refactor the setting to make unit test easier (#22405) 1 year ago
dump.go Refactor the setting to make unit test easier (#22405) 1 year ago
dump_repo.go Refactor the setting to make unit test easier (#22405) 1 year ago
embedded.go Refactor the setting to make unit test easier (#22405) 1 year ago
embedded_stub.go Implement FSFE REUSE for golang files (#21840) 1 year ago
generate.go Implement FSFE REUSE for golang files (#21840) 1 year ago
hook.go Implement actions (#21937) 1 year ago
hook_test.go Implement FSFE REUSE for golang files (#21840) 1 year ago
keys.go Implement FSFE REUSE for golang files (#21840) 1 year ago
mailer.go Refactor the setting to make unit test easier (#22405) 1 year ago
main_test.go Refactor the setting to make unit test easier (#22405) 1 year ago
manager.go Implement FSFE REUSE for golang files (#21840) 1 year ago
manager_logging.go Implement FSFE REUSE for golang files (#21840) 1 year ago
migrate.go Refactor the setting to make unit test easier (#22405) 1 year ago
migrate_storage.go Refactor the setting to make unit test easier (#22405) 1 year ago
migrate_storage_test.go Implement FSFE REUSE for golang files (#21840) 1 year ago
restore_repo.go Refactor the setting to make unit test easier (#22405) 1 year ago
serv.go Refactor the setting to make unit test easier (#22405) 1 year ago
web.go Refactor the setting to make unit test easier (#22405) 1 year ago
web_acme.go Implement FSFE REUSE for golang files (#21840) 1 year ago
web_graceful.go Implement FSFE REUSE for golang files (#21840) 1 year ago
web_https.go Implement FSFE REUSE for golang files (#21840) 1 year ago