2018-04-12 12:07:02 +00:00
|
|
|
package server
|
|
|
|
|
|
|
|
import (
|
|
|
|
cssw "git.loafle.net/commons/server-go/socket/web"
|
|
|
|
"git.loafle.net/overflow/member_gateway_rpc/config"
|
|
|
|
"git.loafle.net/overflow/probe_gateway_rpc/servlet"
|
|
|
|
)
|
|
|
|
|
|
|
|
func New(_config *config.Config) *cssw.Server {
|
|
|
|
|
|
|
|
as := &servlet.AuthServlets{}
|
|
|
|
ps := &servlet.ProbeServlets{}
|
2018-04-13 07:24:30 +00:00
|
|
|
ds := &servlet.DataServlets{}
|
2018-04-12 12:07:02 +00:00
|
|
|
|
|
|
|
sh := &ServerHandlers{
|
|
|
|
ServerHandlers: *_config.ServerHandler,
|
2018-04-12 12:39:48 +00:00
|
|
|
Config: _config,
|
2018-04-12 12:07:02 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
sh.RegisterServlet("/auth", as)
|
|
|
|
sh.RegisterServlet("/probe", ps)
|
2018-04-13 07:24:30 +00:00
|
|
|
sh.RegisterServlet("/data", ds)
|
2018-04-12 12:07:02 +00:00
|
|
|
|
|
|
|
s := &cssw.Server{
|
|
|
|
ServerHandler: sh,
|
|
|
|
}
|
|
|
|
|
|
|
|
return s
|
|
|
|
}
|