48 lines
1.0 KiB
Go
48 lines
1.0 KiB
Go
package server
|
|
|
|
import (
|
|
"reflect"
|
|
|
|
"git.loafle.net/commons_go/server"
|
|
oopcs "git.loafle.net/overflow/overflow_probe_container/server"
|
|
)
|
|
|
|
func newServerHandler(pidPath string, socketHandler SocketHandler, services []interface{}, servicesToStartAndStop []reflect.Type) ServerHandler {
|
|
sh := &ServerHandlers{}
|
|
sh.ServerHandler = oopcs.NewServerHandler(pidPath, "Discovery Containter", socketHandler, services, servicesToStartAndStop)
|
|
|
|
return sh
|
|
}
|
|
|
|
type ServerHandlers struct {
|
|
oopcs.ServerHandler
|
|
}
|
|
|
|
func (sh *ServerHandlers) Init(serverCTX server.ServerContext) error {
|
|
if err := sh.ServerHandler.Init(serverCTX); nil != err {
|
|
return err
|
|
}
|
|
|
|
return nil
|
|
}
|
|
|
|
func (sh *ServerHandlers) OnStart(serverCTX server.ServerContext) {
|
|
sh.ServerHandler.OnStart(serverCTX)
|
|
|
|
}
|
|
|
|
func (sh *ServerHandlers) OnStop(serverCTX server.ServerContext) {
|
|
|
|
sh.ServerHandler.OnStop(serverCTX)
|
|
}
|
|
|
|
func (sh *ServerHandlers) Destroy(serverCTX server.ServerContext) {
|
|
|
|
sh.ServerHandler.Destroy(serverCTX)
|
|
}
|
|
|
|
func (sh *ServerHandlers) Validate() {
|
|
sh.ServerHandler.Validate()
|
|
|
|
}
|