mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2025-05-14 05:52:43 +00:00
Refactor config provider (#24245)
This PR introduces more abstract about `ConfigProvider` and hides more `ini` references. --------- Co-authored-by: delvh <dev.lh@web.de>
This commit is contained in:
parent
56d4893b2a
commit
5cf7da63ee
17 changed files with 227 additions and 164 deletions
|
@ -12,7 +12,6 @@ import (
|
|||
"code.gitea.io/gitea/modules/log"
|
||||
|
||||
"github.com/dustin/go-humanize"
|
||||
ini "gopkg.in/ini.v1"
|
||||
)
|
||||
|
||||
// Package registry settings
|
||||
|
@ -86,7 +85,7 @@ func loadPackagesFrom(rootCfg ConfigProvider) {
|
|||
Packages.LimitSizeVagrant = mustBytes(sec, "LIMIT_SIZE_VAGRANT")
|
||||
}
|
||||
|
||||
func mustBytes(section *ini.Section, key string) int64 {
|
||||
func mustBytes(section ConfigSection, key string) int64 {
|
||||
const noLimit = "-1"
|
||||
|
||||
value := section.Key(key).MustString(noLimit)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue