Compare commits

..

2 Commits

Author SHA1 Message Date
Piotr Biernat
f49b420e78 Merge branch 'develop' into develop-config 2021-07-09 18:34:21 +02:00
Piotr Biernat
8ba2c8b18d Added draft for starting server as separate thread 2021-07-09 18:32:27 +02:00
2 changed files with 38 additions and 0 deletions

View File

@ -1,5 +1,14 @@
package main package main
// ___ ____ ___ ___
// \ \ / / | _ | __| \ \ / / || | __ || || _ |
// \ \/ / |___ | |__ \ \/ / || |___ || ||___|
// \ / | _ | _ | \ / || __ | || ||\\
// \/ |___ |___ | \/ || ____| || || \\
// Copyright (c) 2021 Piotr Biernat. https://pbiernat.dev. MIT License
// Repo: https://git.pbiernat.dev/golang/vegvisir
import ( import (
"vegvisir/server" "vegvisir/server"
) )

View File

@ -1,5 +1,14 @@
package server package server
// ___ ____ ___ ___
// \ \ / / | _ | __| \ \ / / || | __ || || _ |
// \ \/ / |___ | |__ \ \/ / || |___ || ||___|
// \ / | _ | _ | \ / || __ | || ||\\
// \/ |___ |___ | \/ || ____| || || \\
// Copyright (c) 2021 Piotr Biernat. https://pbiernat.dev. MIT License
// Repo: https://git.pbiernat.dev/golang/vegvisir
import ( import (
"encoding/json" "encoding/json"
"io/ioutil" "io/ioutil"
@ -29,3 +38,23 @@ func (s *Server) LoadConfig(file string) error {
return nil return nil
} }
// func Run(s *Server) {
// s.StartListener()
// log.Println("Server started successfully...")
// Wait for an interrupt
// c := make(chan os.Signal, 1)
// signal.Notify(c, os.Interrupt, os.Kill)
// <-c
// log.Error("SIGKILL or SIGINT caught, shutting down...")
// Attempt a graceful shutdown
// ctx, cancel := context.WithTimeout(context.Background(), 5*time.Second)
// defer cancel()
// s.shutdownServers(ctx)
// log.Error("all listeners shut down.")
// }