0
0
mirror of https://github.com/go-gitea/gitea.git synced 2025-11-04 15:04:00 +01:00
Mark Brown bc430bb330
feat: adds setter for config.Value and updates forms
Install now submits the proper database name and is properly set using
the config.Value class. This extends the getter functionality so now
config.Value can be used to both get and set values.
2025-10-16 21:01:44 -04:00

30 lines
507 B
Go

// Copyright 2023 The Gitea Authors. All rights reserved.
// SPDX-License-Identifier: MIT
package config
import (
"context"
"sync"
)
var setterMu sync.RWMutex
type DynKeySetter interface {
SetValue(ctx context.Context, dynKey, value string) error
}
var dynKeySetterInternal DynKeySetter
func SetDynSetter(p DynKeySetter) {
setterMu.Lock()
dynKeySetterInternal = p
setterMu.Unlock()
}
func GetDynSetter() DynKeySetter {
getterMu.RLock()
defer getterMu.RUnlock()
return dynKeySetterInternal
}