[GITEA] add GetFile to config provider
(cherry picked from commit88d1b53eea
) (cherry picked from commitf63f71afad
) (cherry picked from commit1f774145fc
) (cherry picked from commit53e637693b
) (cherry picked from commit4974cbf10a
) (cherry picked from commit554bca7fae
) (cherry picked from commit61b8cf83b9
) (cherry picked from commitd8bcc6f68c
) (cherry picked from commitee04c34072
) (cherry picked from commit713153a6d6
) (cherry picked from commit4e18c4f8bb
) (cherry picked from commit32be9db12d
) (cherry picked from commitfd50e9b9b4
) (cherry picked from commit11717b864b
) (cherry picked from commitb70f3e0fa5
) (cherry picked from commit2d802b2963
)
This commit is contained in:
parent
b45db64300
commit
f61e2f71e2
|
@ -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
|
||||||
|
@ -256,6 +257,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 New Issue