mirror of
https://github.com/Mezeporta/Erupe.git
synced 2025-12-16 17:05:03 +01:00
Hackily get the client to a channel server
This commit is contained in:
25
config/config.go
Normal file
25
config/config.go
Normal file
@@ -0,0 +1,25 @@
|
||||
package config
|
||||
|
||||
import "github.com/BurntSushi/toml"
|
||||
|
||||
// Config holds the configuration settings from the toml file.
|
||||
type Config struct {
|
||||
DB Database `toml:"database"`
|
||||
}
|
||||
|
||||
// Database holds the postgres database config.
|
||||
type Database struct {
|
||||
Server string
|
||||
Port int
|
||||
}
|
||||
|
||||
// LoadConfig loads the given config toml file.
|
||||
func LoadConfig(filepath string) (*Config, error) {
|
||||
c := &Config{}
|
||||
_, err := toml.DecodeFile(filepath, c)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return c, nil
|
||||
}
|
||||
Reference in New Issue
Block a user