mirror of
https://github.com/taigrr/jety.git
synced 2026-04-01 19:08:58 -07:00
34 lines
795 B
Go
34 lines
795 B
Go
package config
|
|
|
|
import (
|
|
"strings"
|
|
)
|
|
|
|
func (c *ConfigManager) SetBool(key string, value bool) {
|
|
c.mutex.Lock()
|
|
defer c.mutex.Unlock()
|
|
lower := strings.ToLower(key)
|
|
c.mapConfig[lower] = ConfigMap{Key: key, Value: value}
|
|
}
|
|
|
|
func (c *ConfigManager) SetString(key string, value string) {
|
|
c.mutex.Lock()
|
|
defer c.mutex.Unlock()
|
|
lower := strings.ToLower(key)
|
|
c.mapConfig[lower] = ConfigMap{Key: key, Value: value}
|
|
}
|
|
|
|
func (c *ConfigManager) Set(key string, value any) {
|
|
c.mutex.Lock()
|
|
defer c.mutex.Unlock()
|
|
lower := strings.ToLower(key)
|
|
c.mapConfig[lower] = ConfigMap{Key: key, Value: value}
|
|
}
|
|
|
|
func (c *ConfigManager) SetDefault(key string, value any) {
|
|
c.mutex.Lock()
|
|
defer c.mutex.Unlock()
|
|
lower := strings.ToLower(key)
|
|
c.defaultConfig[lower] = ConfigMap{Key: key, Value: value}
|
|
}
|