forked from NYANDEV/forgejo
[GITEA] add GetFile to config provider
(cherry picked from commit 88d1b53eeaa0d5ad0ed54c191236db928aadedf0) (cherry picked from commit f63f71afad2aa8272772dba919485c5e858d2fae) (cherry picked from commit 1f774145fc731e2d93cf8a6708dbf4c15722fa5e) (cherry picked from commit 53e637693bcbb9fe9daca9a296c9d2c700fc915b) (cherry picked from commit 4974cbf10a8b51d51591fa6f6281f4cd7a415c91) (cherry picked from commit 554bca7fae7fa6f0235ab631598115875711d80e) (cherry picked from commit 61b8cf83b988a2d8547b81cfb7aaeefaf2e17fba) (cherry picked from commit d8bcc6f68c6dc972e8c99eb7b46a4f096f85cd61) (cherry picked from commit ee04c340724cccada2c71db45ec510d19e92e099) (cherry picked from commit 713153a6d63205984f2a85ee07f08269df3b0a85) (cherry picked from commit 1d51dfa5107b82a7fac43d39deb39e24a85a895e) (cherry picked from commit ee7ae29abb8380a30c1f467943bb6f6411d6c793) (cherry picked from commit b20ebd82542113dea064767e5c439ac2ba34d099) (cherry picked from commit 2e45c9fdc50584f9541384e7f5f4f81f76029f40)
This commit is contained in:
parent
6fd7ef78c7
commit
0418f7cebd
1 changed files with 5 additions and 0 deletions
|
@ -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 {
|
||||||
|
|
Loading…
Reference in a new issue