Versions in this module Expand all Collapse all v1 v1.9.4 Dec 19, 2023 Changes in this version + const APIKeyPrefix + const EgressPrefix + const GuidSize + const IngressPrefix + const NodePrefix + const ParticipantPrefix + const RPCPrefix + const RTMPResourcePrefix + const RoomPrefix + const SIPDispatchRulePrefix + const SIPParticipantPrefix + const SIPTrunkPrefix + const TrackPrefix + const URLResourcePrefix + const WHIPResourcePrefix + var ErrAnachronousSample = errors.New("anachronous sample") + var PromMessageBusCounter = prometheus.NewCounterVec(prometheus.CounterOpts{ ... }, []string{ ... }) + func AggregateRTPStats(statsList []*livekit.RTPStats, gapHistogramSize int) *livekit.RTPStats + func EnableLockTracker() + func GetMimeTypeForAudioCodec(codec livekit.AudioCodec) string + func GetMimeTypeForVideoCodec(codec livekit.VideoCodec) string + func HashedID(id string) string + func IsConnectionQualityLower(prev livekit.ConnectionQuality, curr livekit.ConnectionQuality) bool + func Least[T Numeric](less func(a, b T) bool, vs ...T) T + func LocalNodeID() (string, error) + func MarshalGuid[T livekit.Guid](id T) livekit.GuidBlock + func Max[T Numeric](vs ...T) T + func Min[T Numeric](vs ...T) T + func Most[T Numeric](less func(a, b T) bool, vs ...T) T + func Must[T any](v T, err error) T + func NewGuid(prefix string) string + func NumMutexes() int + func ParallelExec[T any](vals []T, parallelThreshold, step uint64, fn func(T)) + func RandomSecret() string + func Redact(s, name string) string + func RedactIdentifier(identifier string) string + func RedactStreamKey(url string) (string, bool) + func ToggleLockTrackerStackTraces(enable bool) + func UnmarshalGuid[T livekit.Guid](b livekit.GuidBlock) T + type Bitmap struct + func NewBitmap[T bitmapNumber](size int) *Bitmap[T] + func (b *Bitmap[T]) Clear(val T) + func (b *Bitmap[T]) ClearRange(min, max T) + func (b *Bitmap[T]) IsSet(val T) bool + func (b *Bitmap[T]) Set(val T) + func (b *Bitmap[T]) SetRange(min, max T) + type CPUStats struct + func NewCPUStats(idleUpdateCallback func(idle float64)) (*CPUStats, error) + func NewProcCPUStats(procUpdateCallback func(idle float64, usage map[int]float64)) (*CPUStats, error) + func (c *CPUStats) GetCPUIdle() float64 + func (c *CPUStats) NumCPU() float64 + func (c *CPUStats) Stop() + type DedupedSlice struct + func NewDedupedSlice[T comparable](maxLen int) *DedupedSlice[T] + func (d *DedupedSlice[T]) Add(val T) bool + func (d *DedupedSlice[T]) Clear() + func (d *DedupedSlice[T]) Get() []T + func (d *DedupedSlice[T]) Has(val T) bool + func (d *DedupedSlice[T]) Len() int + type ErrArray struct + func (e *ErrArray) AppendErr(err error) + func (e *ErrArray) ToError() psrpc.Error + type EventEmitter struct + func NewDefaultEventEmitter[K comparable, V any]() *EventEmitter[K, V] + func NewEventEmitter[K comparable, V any](params EventEmitterParams) *EventEmitter[K, V] + func (e *EventEmitter[K, V]) Emit(k K, v V) + func (e *EventEmitter[K, V]) Observe(k K) *EventObserver[V] + func (e *EventEmitter[K, V]) ObservedKeys() []K + type EventEmitterParams struct + Logger logger.Logger + QueueSize int + func DefaultEventEmitterParams() EventEmitterParams + type EventObserver struct + func NewEventObserver[V any](stopFunc func()) (*EventObserver[V], func(v V)) + func (o *EventObserver[V]) Events() <-chan V + func (o *EventObserver[V]) Stop() + type EventObserverList struct + func NewDefaultEventObserverList[V any]() *EventObserverList[V] + func NewEventObserverList[V any](params EventEmitterParams) *EventObserverList[V] + func (l *EventObserverList[V]) Emit(v V) + func (l *EventObserverList[V]) Len() int + func (l *EventObserverList[V]) Observe() *EventObserver[V] + type FlowGraph struct + func NewFlowGraph(n int64) FlowGraph + func (g *FlowGraph) AddEdge(s, t, cap, cost int64) + type Graph struct + func NewGraph[K comparable, N GraphNodeProps[K], E GraphEdgeProps]() *Graph[K, N, E] + func (g *Graph[K, N, E]) DeleteEdge(src, dst K) + func (g *Graph[K, N, E]) DeleteNode(id K) + func (g *Graph[K, N, E]) Edge(src, dst K) (p E) + func (g *Graph[K, N, E]) HasEdge(src, dst K) bool + func (g *Graph[K, N, E]) HasNode(id K) bool + func (g *Graph[K, N, E]) InEdges(dst K) map[K]E + func (g *Graph[K, N, E]) InsertEdge(src, dst K, props E) + func (g *Graph[K, N, E]) InsertNode(props N) + func (g *Graph[K, N, E]) Node(id K) (props N) + func (g *Graph[K, N, E]) NodeIDs() []K + func (g *Graph[K, N, E]) OutEdges(src K) map[K]E + func (g *Graph[K, N, E]) ShortestPath(src, dst K) ([]N, int64) + func (g *Graph[K, N, E]) Size() int + func (g *Graph[K, N, E]) TopologicalSort() []N + type GraphEdge struct + type GraphEdgeProps interface + Length func() int64 + type GraphNode struct + type GraphNodeProps interface + ID func() K + type KillableService interface + Kill func() + type MessageBus interface + Publish func(ctx context.Context, channel string, msg proto.Message) error + Subscribe func(ctx context.Context, channel string) (PubSub, error) + SubscribeQueue func(ctx context.Context, channel string) (PubSub, error) + func NewRedisMessageBus(rc redis.UniversalClient) MessageBus + type MinCostMaxFlow struct + func (f *MinCostMaxFlow) ComputeMaxFlow(g FlowGraph, s, t int64) (flow, cost int64) + func (f *MinCostMaxFlow) Flow(s, t int64) int64 + type MultitonService struct + func (s *MultitonService[K]) Kill() + func (s *MultitonService[K]) Replace(k K, v KillableService) func() + type Mutex struct + func (m *Mutex) Lock() + func (m *Mutex) Unlock() + type Numeric interface + type ProtoProxy struct + func NewProtoProxy[T proto.Message](refreshInterval time.Duration, updateFn func() T) *ProtoProxy[T] + func (p *ProtoProxy[T]) Get() T + func (p *ProtoProxy[T]) MarkDirty(immediate bool) + func (p *ProtoProxy[T]) Stop() + func (p *ProtoProxy[T]) Updated() <-chan struct{} + type PubSub interface + Channel func() <-chan interface{} + Close func() error + Payload func(msg interface{}) []byte + type RWMutex struct + func (m *RWMutex) Lock() + func (m *RWMutex) RLock() + func (m *RWMutex) RUnlock() + func (m *RWMutex) Unlock() + type RedisMessageBus struct + func (r *RedisMessageBus) Lock(ctx context.Context, key string, expiration time.Duration) (bool, error) + func (r *RedisMessageBus) Publish(ctx context.Context, channel string, msg proto.Message) error + func (r *RedisMessageBus) Subscribe(ctx context.Context, channel string) (PubSub, error) + func (r *RedisMessageBus) SubscribeQueue(ctx context.Context, channel string) (PubSub, error) + type RedisPubSub struct + func (r *RedisPubSub) Channel() <-chan interface{} + func (r *RedisPubSub) Close() error + func (r *RedisPubSub) Payload(msg interface{}) []byte + type SimpleGraphEdge struct + func (e SimpleGraphEdge) Length() int64 + type StuckLock struct + func ScanTrackedLocks(threshold time.Duration) []*StuckLock + func ScanTrackedLocksI(threshold time.Duration, n int) []*StuckLock + func (d *StuckLock) FirstLockedAtStack() string + func (d *StuckLock) HeldSince() time.Time + func (d *StuckLock) NumGoroutineHeld() int + func (d *StuckLock) NumGoroutineWaiting() int + type TimedAggregator struct + func NewTimedAggregator[T timedAggregatorNumber](params TimedAggregatorParams) *TimedAggregator[T] + func (t *TimedAggregator[T]) AddSample(val T) error + func (t *TimedAggregator[T]) AddSampleAt(val T, at time.Time) error + func (t *TimedAggregator[T]) GetAggregate() (T, time.Duration) + func (t *TimedAggregator[T]) GetAggregateAndRestartAt(at time.Time) (T, time.Duration, error) + func (t *TimedAggregator[T]) GetAggregateAt(at time.Time) (T, time.Duration, error) + func (t *TimedAggregator[T]) GetAverage() float64 + func (t *TimedAggregator[T]) GetAverageAndRestartAt(at time.Time) (float64, error) + func (t *TimedAggregator[T]) GetAverageAt(at time.Time) (float64, error) + func (t *TimedAggregator[T]) Reset() + func (t *TimedAggregator[T]) Restart() + func (t *TimedAggregator[T]) RestartAt(at time.Time) + type TimedAggregatorParams struct + CapNegativeValues bool + type TimedVersion struct + func NewTimedVersionFromProto(proto *livekit.TimedVersion) *TimedVersion + func NewTimedVersionFromTime(t time.Time) *TimedVersion + func TimedVersionFromProto(proto *livekit.TimedVersion) TimedVersion + func TimedVersionFromTime(t time.Time) TimedVersion + func (t *TimedVersion) After(other *TimedVersion) bool + func (t *TimedVersion) Compare(other *TimedVersion) int + func (t *TimedVersion) IsZero() bool + func (t *TimedVersion) Load() TimedVersion + func (t *TimedVersion) Store(other *TimedVersion) + func (t *TimedVersion) String() string + func (t *TimedVersion) Time() time.Time + func (t *TimedVersion) ToProto() *livekit.TimedVersion + func (t *TimedVersion) Update(other *TimedVersion) bool + type TimedVersionGenerator interface + New func() *TimedVersion + Next func() TimedVersion + func NewDefaultTimedVersionGenerator() TimedVersionGenerator + type TimeoutQueue struct + func (q *TimeoutQueue[T]) IterateAfter(timeout time.Duration) *timeoutQueueIterator[T] + func (q *TimeoutQueue[T]) IterateRemoveAfter(timeout time.Duration) *timeoutQueueIterator[T] + func (q *TimeoutQueue[T]) Remove(i *TimeoutQueueItem[T]) + func (q *TimeoutQueue[T]) Reset(i *TimeoutQueueItem[T]) bool + type TimeoutQueueItem struct + Value T + type Welford struct + func WelfordMerge(ws ...Welford) Welford + func (w *Welford) Reset() + func (w *Welford) Update(v float64) + func (w Welford) Count() float64 + func (w Welford) Mean() float64 + func (w Welford) StdDev() float64 + func (w Welford) Value() (mean, variance, sampleVariance float64) + func (w Welford) Variance() float64 + type WorkerGroup struct + func (w *WorkerGroup) Go(fn func()) + func (w *WorkerGroup) Wait()