working commit
This commit is contained in:
+14
-6
@@ -1,7 +1,17 @@
|
||||
package config
|
||||
|
||||
type Config struct {
|
||||
Service Service `json:"service" yaml:"service"`
|
||||
Service Service `json:"service" yaml:"service"`
|
||||
Database Database `json:"database" yaml:"database"`
|
||||
}
|
||||
|
||||
type Service struct {
|
||||
Address string `json:"address" yaml:"address"`
|
||||
Port int64 `json:"port" yaml:"port"`
|
||||
}
|
||||
|
||||
type Database struct {
|
||||
Basepath string `json:"basepath" yaml:"basepath"`
|
||||
}
|
||||
|
||||
func NewConfig() (*Config, error) {
|
||||
@@ -11,10 +21,8 @@ func NewConfig() (*Config, error) {
|
||||
Address: "0.0.0.0",
|
||||
Port: 1025,
|
||||
},
|
||||
Database: Database{
|
||||
Basepath: datadir,
|
||||
},
|
||||
}, err
|
||||
}
|
||||
|
||||
type Service struct {
|
||||
Address string `json:"address" yaml:"address"`
|
||||
Port int64 `json:"port" yaml:"port"`
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user