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"`
|
||||
}
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
package config
|
||||
|
||||
const (
|
||||
confdir = "/home/ziggi/Projects/mstore/etc/mstore"
|
||||
rundir = "/home/ziggi/Projects/mstore/tmp/run"
|
||||
logdir = "/home/ziggi/Projects/mstore/tmp/log"
|
||||
datadir = "/home/ziggi/Projects/mstore/tmp/data"
|
||||
version = "0.1.0"
|
||||
)
|
||||
@@ -0,0 +1,9 @@
|
||||
package config
|
||||
|
||||
const (
|
||||
confdir = "@srv_confdir@"
|
||||
rundir = "@srv_rundir@"
|
||||
logdir = "@srv_logdir@"
|
||||
datadir = "@srv_datadir@"
|
||||
version = "@PACKAGE_VERSION@"
|
||||
)
|
||||
Reference in New Issue
Block a user