ing
This commit is contained in:
parent
9a192c7015
commit
f40ae6579b
|
@ -2,3 +2,4 @@ package: git.loafle.net/overflow/gateway_rest
|
||||||
import:
|
import:
|
||||||
- package: github.com/valyala/fasthttp
|
- package: github.com/valyala/fasthttp
|
||||||
version: ^20160617.0.0
|
version: ^20160617.0.0
|
||||||
|
- package: git.loafle.net/overflow/gateway
|
||||||
|
|
|
@ -5,6 +5,7 @@ import (
|
||||||
|
|
||||||
"git.loafle.net/commons/server-go"
|
"git.loafle.net/commons/server-go"
|
||||||
cswf "git.loafle.net/commons/server-go/web/fasthttp"
|
cswf "git.loafle.net/commons/server-go/web/fasthttp"
|
||||||
|
ogeg "git.loafle.net/overflow/gateway/external/grpc"
|
||||||
)
|
)
|
||||||
|
|
||||||
type ServerHandler interface {
|
type ServerHandler interface {
|
||||||
|
@ -15,6 +16,15 @@ type ServerHandlers struct {
|
||||||
cswf.ServerHandlers
|
cswf.ServerHandlers
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (sh *ServerHandlers) Init(serverCtx server.ServerCtx) error {
|
||||||
|
if err := sh.ServerHandlers.Init(serverCtx); nil != err {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
ogeg.InitPackage()
|
||||||
|
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
func (sh *ServerHandlers) Listener(serverCtx server.ServerCtx) (net.Listener, error) {
|
func (sh *ServerHandlers) Listener(serverCtx server.ServerCtx) (net.Listener, error) {
|
||||||
l, err := net.Listen("tcp", "192.168.1.101:44449")
|
l, err := net.Listen("tcp", "192.168.1.101:44449")
|
||||||
if nil != err {
|
if nil != err {
|
||||||
|
@ -23,3 +33,9 @@ func (sh *ServerHandlers) Listener(serverCtx server.ServerCtx) (net.Listener, er
|
||||||
|
|
||||||
return l, nil
|
return l, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (sh *ServerHandlers) Destroy(serverCtx server.ServerCtx) {
|
||||||
|
ogeg.DestroyPackage()
|
||||||
|
|
||||||
|
sh.ServerHandlers.Destroy(serverCtx)
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user