crusader 1e1e212954 ing
2017-09-01 15:42:23 +09:00

27 lines
616 B
Go

package server
import (
"context"
"time"
"git.loafle.net/commons_go/config"
"git.loafle.net/commons_go/logging"
ogw "git.loafle.net/overflow/overflow_gateway_websocket"
)
func NewServer(ctx context.Context) ogw.Server {
h := &serverHandlers{
ctx: ctx,
logger: logging.WithContext(ctx),
}
h.cfg = config.Sub("websocket")
h.HandshakeTimeout = h.cfg.GetDuration("HandshakeTimeout") * time.Second
h.ReadBufferSize = h.cfg.GetInt("ReadBufferSize")
h.WriteBufferSize = h.cfg.GetInt("WriteBufferSize")
h.EnableCompression = h.cfg.GetBool("EnableCompression")
s := ogw.NewServer(ctx, h)
return s
}