|
|
|
@ -15,12 +15,6 @@ import (
|
|
|
|
|
goxmpp "gosrc.io/xmpp"
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
// YAML config, compatible with the format of Zhabogram 2.0.0
|
|
|
|
|
const configPath string = "config.yml"
|
|
|
|
|
|
|
|
|
|
// JSON schema (not for editing by a user)
|
|
|
|
|
const schemaPath string = "./config_schema.json"
|
|
|
|
|
|
|
|
|
|
var sm *goxmpp.StreamManager
|
|
|
|
|
var component *goxmpp.Component
|
|
|
|
|
var err error
|
|
|
|
@ -30,6 +24,10 @@ var sigintChannel chan os.Signal
|
|
|
|
|
|
|
|
|
|
func main() {
|
|
|
|
|
var profilingPort = flag.Int("profiling-port", 0, "The port for pprof server")
|
|
|
|
|
// YAML config, compatible with the format of Zhabogram 2.0.0
|
|
|
|
|
var configPath = flag.String("config", "config.yml", "Config file path")
|
|
|
|
|
// JSON schema (not for editing by a user)
|
|
|
|
|
var schemaPath = flag.String("schema", "./config_schema.json", "Schema file path")
|
|
|
|
|
flag.Parse()
|
|
|
|
|
|
|
|
|
|
if *profilingPort > 0 {
|
|
|
|
@ -42,7 +40,7 @@ func main() {
|
|
|
|
|
sigintChannel = make(chan os.Signal, 1)
|
|
|
|
|
signal.Notify(sigintChannel, os.Interrupt)
|
|
|
|
|
|
|
|
|
|
config, err := config.ReadConfig(configPath, schemaPath)
|
|
|
|
|
config, err := config.ReadConfig(*configPath, *schemaPath)
|
|
|
|
|
if err != nil {
|
|
|
|
|
log.Fatal(err)
|
|
|
|
|
}
|
|
|
|
|