Documentation
¶
Index ¶
- Constants
- type RedisService
- func (s *RedisService) AcquireJanitorLeaderLock(ctx context.Context, ttl time.Duration) (acquired bool, lockValue string, err error)
- func (s *RedisService) AddAnalyticsHSETType(key string, val map[string]string) error
- func (s *RedisService) AddAnalyticsStringType(key, val string) error
- func (s *RedisService) AddAnalyticsUser(key string, val map[string]string) error
- func (s *RedisService) AddPollResponse(r *plugnmeet.SubmitPollResponseReq) error
- func (s *RedisService) AddRoomWithDurationInfo(roomId string, vals interface{}) error
- func (s *RedisService) AnalyticsDeleteKeys(allKeys []string) error
- func (s *RedisService) AnalyticsGetAllUsers(key string) (map[string]string, error)
- func (s *RedisService) AnalyticsGetKeyType(key string) (string, error)
- func (s *RedisService) AnalyticsScanKeys(pattern string) ([]string, error)
- func (s *RedisService) CleanUpPolls(roomId string, pollIds []string) error
- func (s *RedisService) ClosePoll(r *plugnmeet.ClosePollReq) error
- func (s *RedisService) CreateRoomPoll(roomId string, val map[string]string) error
- func (s *RedisService) DeleteRoomWithDuration(roomId string) error
- func (s *RedisService) GetAnalyticsAllHashTypeVals(key string) (map[string]string, error)
- func (s *RedisService) GetAnalyticsStringTypeVal(key string) (string, error)
- func (s *RedisService) GetPollAllRespondents(roomId, pollId string) ([]string, error)
- func (s *RedisService) GetPollCountersByPollId(roomId, pollId string) (map[string]string, error)
- func (s *RedisService) GetPollIdsByRoomId(roomId string) ([]string, error)
- func (s *RedisService) GetPollInfoByPollId(roomId, pollId string) (string, error)
- func (s *RedisService) GetPollTotalResponses(roomId, pollId string) (string, error)
- func (s *RedisService) GetPollsListByRoomId(roomId string) ([]string, error)
- func (s *RedisService) GetRoomWithDurationInfo(roomId string, dest interface{}) error
- func (s *RedisService) GetRoomWithDurationInfoByKey(key string, dest interface{}) error
- func (s *RedisService) GetRoomsWithDurationKeys() ([]string, error)
- func (s *RedisService) GetTemporaryRoomData(roomId string) *plugnmeet.NatsKvRoomInfo
- func (s *RedisService) HoldTemporaryRoomData(info *plugnmeet.NatsKvRoomInfo)
- func (s *RedisService) IncrementAnalyticsVal(key string, val int64) error
- func (s *RedisService) IsRoomCreationLock(ctx context.Context, roomID string) (isLocked bool, err error)
- func (s *RedisService) LockRoomCreation(ctx context.Context, roomID string, ttl time.Duration) (acquired bool, lockValue string, err error)
- func (s *RedisService) ReleaseJanitorLeadershipLock(ctx context.Context, lockValue string, log *logrus.Entry)
- func (s *RedisService) RenewJanitorLeadershipLock(ctx context.Context, lockValue string, ttl time.Duration) (bool, error)
- func (s *RedisService) SetRoomDuration(roomId, durationField string, val uint64) error
- func (s *RedisService) SpeechToTextAzureKeyRequestedTask(roomId, userId string, task string) (string, error)
- func (s *RedisService) SpeechToTextCheckUserUsage(roomId, userId string) (string, error)
- func (s *RedisService) SpeechToTextDeleteRoom(roomId string) error
- func (s *RedisService) SpeechToTextGetConnectionsByKeyId(keyId string) (string, error)
- func (s *RedisService) SpeechToTextGetHashKeys(roomId string) ([]string, error)
- func (s *RedisService) SpeechToTextGetTotalUsageByRoomId(roomId string) (string, error)
- func (s *RedisService) SpeechToTextUpdateUserStatus(keyId string, task plugnmeet.SpeechServiceUserStatusTasks) error
- func (s *RedisService) SpeechToTextUsersUsage(roomId, userId string, task plugnmeet.SpeechServiceUserStatusTasks) (int64, error)
- func (s *RedisService) UnlockRoomCreation(ctx context.Context, roomID string, lockValue string) error
- func (s *RedisService) UpdateRoomDuration(roomId, durationField string, duration uint64) (int64, error)
Constants ¶
const ( PollTotalRespField = "total_resp" PollCountSuffix = "_count" )
const (
Prefix = "pnm:"
)
const (
RoomCreationLockKey = Prefix + "roomCreationLock-%s"
)
const (
RoomWithDurationInfoKey = Prefix + "roomWithDurationInfo"
)
const SpeechServiceRedisKey = Prefix + "speechService"
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type RedisService ¶
type RedisService struct {
// contains filtered or unexported fields
}
func (*RedisService) AcquireJanitorLeaderLock ¶ added in v1.9.4
func (s *RedisService) AcquireJanitorLeaderLock(ctx context.Context, ttl time.Duration) (acquired bool, lockValue string, err error)
AcquireJanitorLeaderLock attempts to acquire a distributed lock for a janitor leader election.
func (*RedisService) AddAnalyticsHSETType ¶
func (s *RedisService) AddAnalyticsHSETType(key string, val map[string]string) error
func (*RedisService) AddAnalyticsStringType ¶
func (s *RedisService) AddAnalyticsStringType(key, val string) error
func (*RedisService) AddAnalyticsUser ¶
func (s *RedisService) AddAnalyticsUser(key string, val map[string]string) error
func (*RedisService) AddPollResponse ¶
func (s *RedisService) AddPollResponse(r *plugnmeet.SubmitPollResponseReq) error
func (*RedisService) AddRoomWithDurationInfo ¶
func (s *RedisService) AddRoomWithDurationInfo(roomId string, vals interface{}) error
func (*RedisService) AnalyticsDeleteKeys ¶
func (s *RedisService) AnalyticsDeleteKeys(allKeys []string) error
func (*RedisService) AnalyticsGetAllUsers ¶
func (s *RedisService) AnalyticsGetAllUsers(key string) (map[string]string, error)
func (*RedisService) AnalyticsGetKeyType ¶
func (s *RedisService) AnalyticsGetKeyType(key string) (string, error)
func (*RedisService) AnalyticsScanKeys ¶ added in v1.9.3
func (s *RedisService) AnalyticsScanKeys(pattern string) ([]string, error)
func (*RedisService) CleanUpPolls ¶
func (s *RedisService) CleanUpPolls(roomId string, pollIds []string) error
func (*RedisService) ClosePoll ¶
func (s *RedisService) ClosePoll(r *plugnmeet.ClosePollReq) error
func (*RedisService) CreateRoomPoll ¶
func (s *RedisService) CreateRoomPoll(roomId string, val map[string]string) error
func (*RedisService) DeleteRoomWithDuration ¶
func (s *RedisService) DeleteRoomWithDuration(roomId string) error
func (*RedisService) GetAnalyticsAllHashTypeVals ¶
func (s *RedisService) GetAnalyticsAllHashTypeVals(key string) (map[string]string, error)
func (*RedisService) GetAnalyticsStringTypeVal ¶
func (s *RedisService) GetAnalyticsStringTypeVal(key string) (string, error)
func (*RedisService) GetPollAllRespondents ¶ added in v1.9.3
func (s *RedisService) GetPollAllRespondents(roomId, pollId string) ([]string, error)
func (*RedisService) GetPollCountersByPollId ¶ added in v1.9.3
func (s *RedisService) GetPollCountersByPollId(roomId, pollId string) (map[string]string, error)
func (*RedisService) GetPollIdsByRoomId ¶ added in v1.9.3
func (s *RedisService) GetPollIdsByRoomId(roomId string) ([]string, error)
func (*RedisService) GetPollInfoByPollId ¶
func (s *RedisService) GetPollInfoByPollId(roomId, pollId string) (string, error)
func (*RedisService) GetPollTotalResponses ¶ added in v1.9.3
func (s *RedisService) GetPollTotalResponses(roomId, pollId string) (string, error)
func (*RedisService) GetPollsListByRoomId ¶
func (s *RedisService) GetPollsListByRoomId(roomId string) ([]string, error)
func (*RedisService) GetRoomWithDurationInfo ¶
func (s *RedisService) GetRoomWithDurationInfo(roomId string, dest interface{}) error
func (*RedisService) GetRoomWithDurationInfoByKey ¶
func (s *RedisService) GetRoomWithDurationInfoByKey(key string, dest interface{}) error
func (*RedisService) GetRoomsWithDurationKeys ¶
func (s *RedisService) GetRoomsWithDurationKeys() ([]string, error)
func (*RedisService) GetTemporaryRoomData ¶ added in v1.9.3
func (s *RedisService) GetTemporaryRoomData(roomId string) *plugnmeet.NatsKvRoomInfo
func (*RedisService) HoldTemporaryRoomData ¶ added in v1.9.3
func (s *RedisService) HoldTemporaryRoomData(info *plugnmeet.NatsKvRoomInfo)
func (*RedisService) IncrementAnalyticsVal ¶
func (s *RedisService) IncrementAnalyticsVal(key string, val int64) error
func (*RedisService) IsRoomCreationLock ¶
func (s *RedisService) IsRoomCreationLock(ctx context.Context, roomID string) (isLocked bool, err error)
IsRoomCreationLock checks if the room creation lock key exists in Redis. Returns true if locked, false if not locked. Returns an error for Redis communication issues.
func (*RedisService) LockRoomCreation ¶
func (s *RedisService) LockRoomCreation(ctx context.Context, roomID string, ttl time.Duration) (acquired bool, lockValue string, err error)
LockRoomCreation attempts to acquire a distributed lock. Returns: - acquired (bool): true if the lock was acquired. - lockValue (string): A unique value if acquired, to be used for safe unlocking. Empty if not acquired. - err (error): For Redis communication errors.
func (*RedisService) ReleaseJanitorLeadershipLock ¶ added in v1.9.4
func (s *RedisService) ReleaseJanitorLeadershipLock(ctx context.Context, lockValue string, log *logrus.Entry)
ReleaseJanitorLeadershipLock safely releases a janitor task lock.
func (*RedisService) RenewJanitorLeadershipLock ¶ added in v1.9.4
func (s *RedisService) RenewJanitorLeadershipLock(ctx context.Context, lockValue string, ttl time.Duration) (bool, error)
RenewJanitorLeadershipLock extends the TTL of a lock if it's still held by the same owner. Returns true if the lock was successfully renewed.
func (*RedisService) SetRoomDuration ¶
func (s *RedisService) SetRoomDuration(roomId, durationField string, val uint64) error
func (*RedisService) SpeechToTextAzureKeyRequestedTask ¶
func (s *RedisService) SpeechToTextAzureKeyRequestedTask(roomId, userId string, task string) (string, error)
func (*RedisService) SpeechToTextCheckUserUsage ¶
func (s *RedisService) SpeechToTextCheckUserUsage(roomId, userId string) (string, error)
func (*RedisService) SpeechToTextDeleteRoom ¶
func (s *RedisService) SpeechToTextDeleteRoom(roomId string) error
func (*RedisService) SpeechToTextGetConnectionsByKeyId ¶
func (s *RedisService) SpeechToTextGetConnectionsByKeyId(keyId string) (string, error)
func (*RedisService) SpeechToTextGetHashKeys ¶
func (s *RedisService) SpeechToTextGetHashKeys(roomId string) ([]string, error)
func (*RedisService) SpeechToTextGetTotalUsageByRoomId ¶
func (s *RedisService) SpeechToTextGetTotalUsageByRoomId(roomId string) (string, error)
func (*RedisService) SpeechToTextUpdateUserStatus ¶
func (s *RedisService) SpeechToTextUpdateUserStatus(keyId string, task plugnmeet.SpeechServiceUserStatusTasks) error
func (*RedisService) SpeechToTextUsersUsage ¶
func (s *RedisService) SpeechToTextUsersUsage(roomId, userId string, task plugnmeet.SpeechServiceUserStatusTasks) (int64, error)
func (*RedisService) UnlockRoomCreation ¶
func (s *RedisService) UnlockRoomCreation(ctx context.Context, roomID string, lockValue string) error
UnlockRoomCreation safely releases a lock using the lockValue.
func (*RedisService) UpdateRoomDuration ¶
func (s *RedisService) UpdateRoomDuration(roomId, durationField string, duration uint64) (int64, error)