package protocol import ( "git.noahlan.cn/noahlan/nnet/connection" "git.noahlan.cn/noahlan/nnet/packet" rt "git.noahlan.cn/noahlan/nnet/router" ) type Router struct { handler rt.Handler } func NewRouter(handler rt.Handler) rt.Router { return &Router{ handler: handler, } } func (r *Router) Handle(c *connection.Connection, pkg packet.IPacket) { r.handler.Handle(c, pkg) } func (r *Router) Register(_ interface{}, handler rt.Handler) error { r.handler = handler return nil } func (r *Router) SetNotFoundHandler(_ rt.Handler) { }