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

12 lines
283 B

  1. package znet
  2. import "github.com/aceld/zinx/ziface"
  3. type Option func(s *Server)
  4. // 只要实现Packet 接口可自由实现数据包解析格式,如果没有则使用默认解析格式
  5. func WithPacket(pack ziface.Packet) Option {
  6. return func(s *Server) {
  7. s.packet = pack
  8. }
  9. }