optimistic writeback and pessimistic read

This commit is contained in:
2023-11-03 00:56:56 -07:00
parent 0fc1bf396d
commit 610b979966
3 changed files with 139 additions and 93 deletions

View File

@@ -28,6 +28,7 @@ type (
ConfigManager struct {
configName string
configPath string
configFileUsed string
configType configType
envPrefix string
@@ -201,6 +202,12 @@ func readFile(filename string, fileType configType) (map[string]any, error) {
}
}
func (c *ConfigManager) SetConfigDir(path string) {
c.mutex.Lock()
defer c.mutex.Unlock()
c.configPath = name
}
func (c *ConfigManager) SetConfigName(name string) {
c.mutex.Lock()
defer c.mutex.Unlock()