package protocol import ( "git.noahlan.cn/noahlan/nnet/conn" "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(nc *conn.Connection, pkg packet.IPacket) { r.handler.Handle(nc, pkg) } func (r *Router) Register(_ any, handler rt.Handler) error { r.handler = handler return nil } func (r *Router) SetNotFoundHandler(_ rt.Handler) { }