This commit is contained in:
@@ -1 +1,21 @@
|
||||
package config
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"gopkg.in/yaml.v3"
|
||||
"os"
|
||||
)
|
||||
|
||||
func ImportSettings(path string) (*HellreigN, error) {
|
||||
data, err := os.ReadFile(path)
|
||||
if err != nil {
|
||||
fmt.Println(err)
|
||||
}
|
||||
var cfg HellreigN
|
||||
|
||||
if err := yaml.Unmarshal(data, &cfg); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return &cfg, nil
|
||||
}
|
||||
|
||||
@@ -1,4 +1,13 @@
|
||||
package config
|
||||
|
||||
type Config struct {
|
||||
type HellreigN struct {
|
||||
Database Databases `yaml:"database"`
|
||||
}
|
||||
|
||||
type Databases struct {
|
||||
Token_db string `yaml:"token_db"`
|
||||
Clickhouse_host string `yaml:"clickhouse_host"`
|
||||
Clickhouse_user string `yaml:"clickhouse_user"`
|
||||
Clickhouse_password string `yaml:"clickhouse_password"`
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user