You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
nnet/core/types.go

21 lines
407 B
Go

package core
import (
"git.noahlan.cn/noahlan/nnet/entity"
"git.noahlan.cn/noahlan/nnet/packet"
)
type (
Handler interface {
Handle(entity entity.NetworkEntity, pkg packet.IPacket)
}
HandlerFunc func(entity entity.NetworkEntity, pkg packet.IPacket)
Middleware func(next HandlerFunc) HandlerFunc
)
func (f HandlerFunc) Handle(entity entity.NetworkEntity, pkg packet.IPacket) {
f(entity, pkg)
}