* WIP commit * update protocol * Fixing a test and catching one place where casting was missed * Fix one more spot which need conversion from livekit.RoomName -> string * do not covert list
23 lines
514 B
Go
23 lines
514 B
Go
package routing
|
|
|
|
import (
|
|
"errors"
|
|
"strings"
|
|
|
|
"github.com/livekit/protocol/livekit"
|
|
)
|
|
|
|
func participantKey(roomName livekit.RoomName, identity livekit.ParticipantIdentity) string {
|
|
return string(roomName) + "|" + identity
|
|
}
|
|
|
|
func parseParticipantKey(pkey string) (roomName livekit.RoomName, identity livekit.ParticipantIdentity, err error) {
|
|
parts := strings.Split(pkey, "|")
|
|
if len(parts) != 2 {
|
|
err = errors.New("invalid participant key")
|
|
return
|
|
}
|
|
|
|
return livekit.RoomName(parts[0]), parts[1], nil
|
|
}
|