yjp il y a 10 mois
Parent
commit
343fddd23d
1 fichiers modifiés avec 2 ajouts et 2 suppressions
  1. 2 2
      websocket/websocket.go

+ 2 - 2
websocket/websocket.go

@@ -128,8 +128,8 @@ func (m *Manager) BroadCast(groupID string, msg []byte) error {
 
 
 type ConnectionOption func(sessionMap map[string]any)
 type ConnectionOption func(sessionMap map[string]any)
 
 
-func WithConnectionContext(key string, context any) ConnectionOption {
+func WithConnectionContext(context any) ConnectionOption {
 	return func(sessionMap map[string]any) {
 	return func(sessionMap map[string]any) {
-		sessionMap[connectionContextKey+"::"+key] = context
+		sessionMap[connectionContextKey] = context
 	}
 	}
 }
 }