feat: support custom connection struct

This commit is contained in:
2025-04-27 15:37:04 +02:00
parent e12437d067
commit 529dad17cf
2 changed files with 10 additions and 15 deletions

View File

@ -4,22 +4,21 @@ import (
"encoding/json"
"errors"
"fmt"
"net"
"slices"
)
type Request struct {
conn net.Conn
conn *Connection
packet *Packet
}
func NewRequest(conn net.Conn, packet *Packet) *Request {
func NewRequest(conn *Connection, packet *Packet) *Request {
return &Request{
conn, packet,
}
}
func (req *Request) Conn() net.Conn {
func (req *Request) Conn() *Connection {
return req.conn
}