[GITEA] add GetFile to config provider

(cherry picked from commit 88d1b53eea)
(cherry picked from commit f63f71afad)
(cherry picked from commit 1f774145fc)
(cherry picked from commit 53e637693b)
(cherry picked from commit 4974cbf10a)
(cherry picked from commit 554bca7fae)
(cherry picked from commit 61b8cf83b9)
(cherry picked from commit d8bcc6f68c)
(cherry picked from commit ee04c34072)
(cherry picked from commit 713153a6d6)
(cherry picked from commit 1d51dfa510)
(cherry picked from commit ee7ae29abb)
(cherry picked from commit b20ebd8254)
(cherry picked from commit 2e45c9fdc5)
This commit is contained in:
Earl Warren 2023-08-11 11:06:31 +02:00
parent 6fd7ef78c7
commit 0418f7cebd
No known key found for this signature in database
GPG key ID: 0579CB2928A78A00

View file

@ -53,6 +53,7 @@ type ConfigProvider interface {
Save() error Save() error
SaveTo(filename string) error SaveTo(filename string) error
GetFile() string
DisableSaving() DisableSaving()
PrepareSaving() (ConfigProvider, error) PrepareSaving() (ConfigProvider, error)
IsLoadedFromEmpty() bool IsLoadedFromEmpty() bool
@ -258,6 +259,10 @@ func (p *iniConfigProvider) GetSection(name string) (ConfigSection, error) {
var errDisableSaving = errors.New("this config can't be saved, developers should prepare a new config to save") var errDisableSaving = errors.New("this config can't be saved, developers should prepare a new config to save")
func (p *iniConfigProvider) GetFile() string {
return p.file
}
// Save saves the content into file // Save saves the content into file
func (p *iniConfigProvider) Save() error { func (p *iniConfigProvider) Save() error {
if p.disableSaving { if p.disableSaving {