Interfaces (#97)
* create interface * move room manager to interface * interfaces * updates * fix loop * fix fakes * remove node types
This commit is contained in:
@@ -38,7 +38,7 @@ func NewRedisRoomStore(rc *redis.Client) *RedisRoomStore {
|
||||
}
|
||||
}
|
||||
|
||||
func (p *RedisRoomStore) CreateRoom(room *livekit.Room) error {
|
||||
func (p *RedisRoomStore) StoreRoom(room *livekit.Room) error {
|
||||
if room.CreationTime == 0 {
|
||||
room.CreationTime = time.Now().Unix()
|
||||
}
|
||||
@@ -58,7 +58,7 @@ func (p *RedisRoomStore) CreateRoom(room *livekit.Room) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
func (p *RedisRoomStore) GetRoom(idOrName string) (*livekit.Room, error) {
|
||||
func (p *RedisRoomStore) LoadRoom(idOrName string) (*livekit.Room, error) {
|
||||
// see if matches any ids
|
||||
name, err := p.rc.HGet(p.ctx, RoomIdMap, idOrName).Result()
|
||||
if err != nil {
|
||||
@@ -102,7 +102,7 @@ func (p *RedisRoomStore) ListRooms() ([]*livekit.Room, error) {
|
||||
}
|
||||
|
||||
func (p *RedisRoomStore) DeleteRoom(idOrName string) error {
|
||||
room, err := p.GetRoom(idOrName)
|
||||
room, err := p.LoadRoom(idOrName)
|
||||
var sid, name string
|
||||
|
||||
if err == ErrRoomNotFound {
|
||||
@@ -167,7 +167,7 @@ func (p *RedisRoomStore) UnlockRoom(name string, uid string) error {
|
||||
return p.rc.Del(p.ctx, key).Err()
|
||||
}
|
||||
|
||||
func (p *RedisRoomStore) PersistParticipant(roomName string, participant *livekit.ParticipantInfo) error {
|
||||
func (p *RedisRoomStore) StoreParticipant(roomName string, participant *livekit.ParticipantInfo) error {
|
||||
key := RoomParticipantsPrefix + roomName
|
||||
|
||||
data, err := proto.Marshal(participant)
|
||||
@@ -178,7 +178,7 @@ func (p *RedisRoomStore) PersistParticipant(roomName string, participant *liveki
|
||||
return p.rc.HSet(p.ctx, key, participant.Identity, data).Err()
|
||||
}
|
||||
|
||||
func (p *RedisRoomStore) GetParticipant(roomName, identity string) (*livekit.ParticipantInfo, error) {
|
||||
func (p *RedisRoomStore) LoadParticipant(roomName, identity string) (*livekit.ParticipantInfo, error) {
|
||||
key := RoomParticipantsPrefix + roomName
|
||||
data, err := p.rc.HGet(p.ctx, key, identity).Result()
|
||||
if err == redis.Nil {
|
||||
|
||||
Reference in New Issue
Block a user