mirror of
https://github.com/livekit/livekit.git
synced 2026-03-30 22:05:39 +00:00
21 lines
379 B
Go
21 lines
379 B
Go
package routing
|
|
|
|
import (
|
|
"errors"
|
|
"strings"
|
|
)
|
|
|
|
func participantKey(roomName, identity string) string {
|
|
return roomName + "|" + identity
|
|
}
|
|
|
|
func parseParticipantKey(pkey string) (roomName string, identity string, err error) {
|
|
parts := strings.Split(pkey, "|")
|
|
if len(parts) != 2 {
|
|
err = errors.New("invalid participant key")
|
|
return
|
|
}
|
|
|
|
return parts[0], parts[1], nil
|
|
}
|