27 lines
377 B
Go
27 lines
377 B
Go
package main
|
|
|
|
import (
|
|
"log"
|
|
|
|
"nefrace.ru/doomer/config"
|
|
)
|
|
|
|
func main() {
|
|
cfg := config.InitConfig()
|
|
db, err := NewDatabase()
|
|
if err != nil {
|
|
log.Fatalf("Cant open database: %v", err)
|
|
}
|
|
|
|
defer db.Close()
|
|
doomer := NewDoomer(db)
|
|
|
|
dp := NewDispatcher(doomer)
|
|
|
|
server := CreateServer(db)
|
|
go func() {
|
|
log.Fatal(server.Start(cfg.Host))
|
|
}()
|
|
log.Println(dp.Poll())
|
|
}
|