Hackily get the client to a channel server

This commit is contained in:
Andrew Gutekanst
2019-12-24 00:20:35 +09:00
parent 7aef17f7d9
commit e5066d4f8b
13 changed files with 1275 additions and 27 deletions

25
config/config.go Normal file
View 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
}