base-golang/pkg/websocket/peer/connection.go

24 lines
331 B
Go
Raw Normal View History

2024-07-23 10:23:43 +08:00
package peer
type Connection interface {
Raw() any
Peer() *SessionManager
Send(msg []byte) error
Close()
ID() int64
RemoteAddr() string
IsClosed() bool
}
type ConnectionIdentify struct {
id int64
}
func (ci *ConnectionIdentify) ID() int64 {
return ci.id
}
func (ci *ConnectionIdentify) SetID(id int64) {
ci.id = id
}