Added the currency_affinity field to the configuration
This commit is contained in:
+15
-7
@@ -8,12 +8,13 @@ import (
|
||||
)
|
||||
|
||||
type Configuration struct {
|
||||
AssetsDir string `yaml:"assets"`
|
||||
Port string `yaml:"port"`
|
||||
DBSys string `yaml:"dbsys"`
|
||||
DBPath string `yaml:"dbpath"`
|
||||
MigrationsPath string `yaml:"migrations_path"`
|
||||
MigCustomScript string `yaml:"mig_custom_scripts"`
|
||||
AssetsDir string `yaml:"assets"`
|
||||
Port string `yaml:"port"`
|
||||
DBSys string `yaml:"dbsys"`
|
||||
DBPath string `yaml:"dbpath"`
|
||||
MigrationsPath string `yaml:"migrations_path"`
|
||||
MigCustomScript string `yaml:"mig_custom_scripts"`
|
||||
CurrencyAffinity int32 `yaml:"currency_affinity"`
|
||||
}
|
||||
|
||||
var (
|
||||
@@ -24,6 +25,9 @@ var (
|
||||
|
||||
func GetInstance() *Configuration {
|
||||
once.Do(func() {
|
||||
if instance != nil {
|
||||
return
|
||||
}
|
||||
instance = &Configuration{}
|
||||
instance.loadConfiguration()
|
||||
})
|
||||
@@ -31,10 +35,14 @@ func GetInstance() *Configuration {
|
||||
return instance
|
||||
}
|
||||
|
||||
func SetConfig(path string) {
|
||||
func SetConfPath(path string) {
|
||||
confPath = path
|
||||
}
|
||||
|
||||
func SetConfiguration(config *Configuration) {
|
||||
instance = config
|
||||
}
|
||||
|
||||
func (c *Configuration) loadConfiguration() {
|
||||
file, err := os.ReadFile(confPath)
|
||||
if err != nil {
|
||||
|
||||
Reference in New Issue
Block a user