ing
This commit is contained in:
parent
65a0d2181d
commit
a039ce356a
|
@ -1,2 +0,0 @@
|
|||
package: git.loafle.net/overflow/overflow_gateway_webapp
|
||||
import: []
|
33
main.go
33
main.go
|
@ -1,5 +1,38 @@
|
|||
package main
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"log"
|
||||
"os"
|
||||
"os/signal"
|
||||
"syscall"
|
||||
|
||||
"git.loafle.net/commons_go/logging"
|
||||
"git.loafle.net/overflow/overflow_gateway_webapp/server"
|
||||
oogws "git.loafle.net/overflow/overflow_gateway_websocket/server"
|
||||
)
|
||||
|
||||
func main() {
|
||||
defer logging.Logger().Sync()
|
||||
|
||||
sh := &server.ServerHandlers{}
|
||||
s := oogws.New(sh)
|
||||
|
||||
stop := make(chan os.Signal)
|
||||
signal.Notify(stop, syscall.SIGINT)
|
||||
|
||||
go func() {
|
||||
if err := s.Start(); nil != err {
|
||||
log.Printf("Server: Start error %v", err)
|
||||
return
|
||||
}
|
||||
}()
|
||||
|
||||
select {
|
||||
case signal := <-stop:
|
||||
fmt.Printf("Got signal: %v\n", signal)
|
||||
}
|
||||
|
||||
s.Stop()
|
||||
|
||||
}
|
||||
|
|
33
server/server_handlers.go
Normal file
33
server/server_handlers.go
Normal file
|
@ -0,0 +1,33 @@
|
|||
package server
|
||||
|
||||
import (
|
||||
cwfs "git.loafle.net/commons_go/websocket_fasthttp/server"
|
||||
)
|
||||
|
||||
type ServerHandlers struct {
|
||||
cwfs.ServerHandlers
|
||||
}
|
||||
|
||||
// Init invoked before the server is started
|
||||
// If you override ths method, must call
|
||||
func (sh *ServerHandlers) Init() error {
|
||||
if err := sh.ServerHandlers.Init(); nil != err {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
func (sh *ServerHandlers) OnStart() {
|
||||
sh.ServerHandlers.OnStart()
|
||||
|
||||
}
|
||||
|
||||
func (sh *ServerHandlers) OnStop() {
|
||||
|
||||
sh.ServerHandlers.OnStop()
|
||||
}
|
||||
|
||||
func (sh *ServerHandlers) Validate() {
|
||||
sh.ServerHandlers.Validate()
|
||||
}
|
1
servlet/web/servlet.go
Normal file
1
servlet/web/servlet.go
Normal file
|
@ -0,0 +1 @@
|
|||
package web
|
2
servlet/web/subscriber_handlers.go
Normal file
2
servlet/web/subscriber_handlers.go
Normal file
|
@ -0,0 +1,2 @@
|
|||
package web
|
||||
|
Loading…
Reference in New Issue
Block a user