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.
21 lines
407 B
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)
|
|
}
|