session.go 200 B

123456789101112131415161718
  1. package peer
  2. import (
  3. "sync"
  4. )
  5. type Session struct {
  6. Conn Connection
  7. Data sync.Map
  8. }
  9. func NewSession(conn Connection) *Session {
  10. s := &Session{
  11. Conn: conn,
  12. Data: sync.Map{},
  13. }
  14. return s
  15. }