ing
This commit is contained in:
parent
f8580434e8
commit
f4a6b873f1
|
@ -1,6 +1,5 @@
|
|||
package sqlserver
|
||||
|
||||
|
||||
import (
|
||||
cnsms "git.loafle.net/commons_go/network_service_matcher/sqlserver"
|
||||
configM "git.loafle.net/overflow/overflow_commons_go/modules/config/model"
|
||||
|
|
7
main.go
7
main.go
|
@ -13,19 +13,18 @@ import (
|
|||
)
|
||||
|
||||
var (
|
||||
sockFile *string
|
||||
pidPath *string
|
||||
)
|
||||
|
||||
func init() {
|
||||
sockFile = flag.String("sock", serverAddr, "Socket file")
|
||||
pidPath = flag.String("pid-path", "/tmp/network-container.pid", "The path of pid file")
|
||||
flag.Parse()
|
||||
|
||||
}
|
||||
|
||||
func main() {
|
||||
defer logging.Logger().Sync()
|
||||
|
||||
s := server.New(*sockFile)
|
||||
s := server.New(*pidPath)
|
||||
|
||||
stop := make(chan os.Signal)
|
||||
signal.Notify(stop, syscall.SIGINT)
|
||||
|
|
|
@ -1,3 +0,0 @@
|
|||
package main
|
||||
|
||||
var serverAddr string = "/tmp/container_network.sock"
|
|
@ -1,3 +0,0 @@
|
|||
package main
|
||||
|
||||
var serverAddr string = "container_network"
|
|
@ -7,14 +7,14 @@ import (
|
|||
"git.loafle.net/overflow/overflow_probe_container_network/service"
|
||||
)
|
||||
|
||||
func New(addr string) server.Server {
|
||||
func New(pidPath string) server.Server {
|
||||
rpcRegistry := crr.NewRPCRegistry()
|
||||
service.RegisterRPC(rpcRegistry)
|
||||
|
||||
rpcSH := oopcs.NewRPCServletHandler(rpcRegistry)
|
||||
socketHandler := newSocketHandler(rpcSH)
|
||||
|
||||
sh := newServerHandler(addr, socketHandler)
|
||||
sh := newServerHandler(pidPath, socketHandler)
|
||||
s := oopcs.New(sh)
|
||||
|
||||
return s
|
||||
|
|
|
@ -5,9 +5,9 @@ import (
|
|||
oopcs "git.loafle.net/overflow/overflow_probe_container/server"
|
||||
)
|
||||
|
||||
func newServerHandler(addr string, socketHandler SocketHandler) ServerHandler {
|
||||
func newServerHandler(pidPath string, socketHandler SocketHandler) ServerHandler {
|
||||
sh := &ServerHandlers{}
|
||||
sh.ServerHandler = oopcs.NewServerHandler(addr, "Discovery Containter", socketHandler)
|
||||
sh.ServerHandler = oopcs.NewServerHandler(pidPath, "Discovery Containter", socketHandler)
|
||||
|
||||
return sh
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user