mirror of
https://github.com/taigrr/jety.git
synced 2026-04-02 03:19:03 -07:00
type block, remove ae param
This commit is contained in:
@@ -2,7 +2,7 @@ package config
|
||||
|
||||
import "time"
|
||||
|
||||
var defaultConfigManager = NewConfigManager(true)
|
||||
var defaultConfigManager = NewConfigManager()
|
||||
|
||||
func GetIntSlice(key string) []int {
|
||||
return defaultConfigManager.GetIntSlice(key)
|
||||
|
||||
12
jety.go
12
jety.go
@@ -12,20 +12,21 @@ import (
|
||||
"gopkg.in/yaml.v3"
|
||||
)
|
||||
|
||||
type configType string
|
||||
|
||||
const (
|
||||
ConfigTypeTOML configType = "toml"
|
||||
ConfigTypeYAML configType = "yaml"
|
||||
ConfigTypeJSON configType = "json"
|
||||
)
|
||||
|
||||
type ConfigMap struct {
|
||||
type (
|
||||
configType string
|
||||
|
||||
ConfigMap struct {
|
||||
Key string
|
||||
Value any
|
||||
}
|
||||
|
||||
type ConfigManager struct {
|
||||
ConfigManager struct {
|
||||
configName string
|
||||
configFileUsed string
|
||||
configType configType
|
||||
@@ -37,10 +38,11 @@ type ConfigManager struct {
|
||||
mutex sync.RWMutex
|
||||
explicitDefaults bool
|
||||
}
|
||||
)
|
||||
|
||||
var ErrConfigFileNotFound = errors.New("config File Not Found")
|
||||
|
||||
func NewConfigManager(automaticEnv bool) *ConfigManager {
|
||||
func NewConfigManager() *ConfigManager {
|
||||
cm := ConfigManager{}
|
||||
cm.envConfig = make(map[string]ConfigMap)
|
||||
cm.mapConfig = make(map[string]ConfigMap)
|
||||
|
||||
Reference in New Issue
Block a user