utils

package
v1.9.4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 15, 2025 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ComponentPub       = "pub"
	ComponentSub       = "sub"
	ComponentRoom      = "room"
	ComponentAPI       = "api"
	ComponentTransport = "transport"
	ComponentSFU       = "sfu"
	// transport subcomponents
	ComponentCongestionControl = "cc"
)

Variables

This section is empty.

Functions

func ClientInfoWithoutAddress added in v1.5.2

func ClientInfoWithoutAddress(c *livekit.ClientInfo) *livekit.ClientInfo

func ContextWithAttempt added in v1.3.4

func ContextWithAttempt(ctx context.Context, attempt int) context.Context

func ContextWithLogger added in v1.5.2

func ContextWithLogger(ctx context.Context, logger logger.Logger) context.Context

func DedupeSlice added in v1.9.0

func DedupeSlice[T cmp.Ordered](s []T) []T

func GetAttempt added in v1.3.4

func GetAttempt(ctx context.Context) int

func GetLogger added in v1.5.2

func GetLogger(ctx context.Context) logger.Logger

func MedianFloat32 added in v1.4.3

func MedianFloat32(input []float32) float32

MedianFloat32 gets median value for an array of float32

Types

type ChangeNotifier added in v1.3.4

type ChangeNotifier struct {
	// contains filtered or unexported fields
}

func NewChangeNotifier added in v1.3.4

func NewChangeNotifier() *ChangeNotifier

func (*ChangeNotifier) AddObserver added in v1.3.4

func (n *ChangeNotifier) AddObserver(key string, onChanged func())

func (*ChangeNotifier) HasObservers added in v1.3.4

func (n *ChangeNotifier) HasObservers() bool

func (*ChangeNotifier) NotifyChanged added in v1.3.4

func (n *ChangeNotifier) NotifyChanged()

func (*ChangeNotifier) RemoveObserver added in v1.3.4

func (n *ChangeNotifier) RemoveObserver(key string)

type ChangeNotifierManager added in v1.3.4

type ChangeNotifierManager struct {
	// contains filtered or unexported fields
}

func NewChangeNotifierManager added in v1.3.4

func NewChangeNotifierManager() *ChangeNotifierManager

func (*ChangeNotifierManager) GetNotifier added in v1.3.4

func (m *ChangeNotifierManager) GetNotifier(key string) *ChangeNotifier

func (*ChangeNotifierManager) GetOrCreateNotifier added in v1.3.4

func (m *ChangeNotifierManager) GetOrCreateNotifier(key string) *ChangeNotifier

func (*ChangeNotifierManager) RemoveNotifier added in v1.3.4

func (m *ChangeNotifierManager) RemoveNotifier(key string, force bool)

type IceConfigCache added in v1.6.1

type IceConfigCache[T comparable] struct {
	// contains filtered or unexported fields
}

func NewIceConfigCache added in v1.6.1

func NewIceConfigCache[T comparable](ttl time.Duration) *IceConfigCache[T]

func (*IceConfigCache[T]) Get added in v1.6.1

func (icc *IceConfigCache[T]) Get(key T) *livekit.ICEConfig

func (*IceConfigCache[T]) Put added in v1.6.1

func (icc *IceConfigCache[T]) Put(key T, iceConfig *livekit.ICEConfig)

func (*IceConfigCache[T]) Stop added in v1.6.1

func (icc *IceConfigCache[T]) Stop()

type IncrementalDispatcher added in v1.6.0

type IncrementalDispatcher[T any] struct {
	// contains filtered or unexported fields
}

IncrementalDispatcher is a dispatcher that allows multiple consumers to consume items as they become available, while producers can add items at anytime.

func NewIncrementalDispatcher added in v1.6.0

func NewIncrementalDispatcher[T any]() *IncrementalDispatcher[T]

func (*IncrementalDispatcher[T]) Add added in v1.6.0

func (d *IncrementalDispatcher[T]) Add(item T)

func (*IncrementalDispatcher[T]) Done added in v1.6.0

func (d *IncrementalDispatcher[T]) Done()

func (*IncrementalDispatcher[T]) ForEach added in v1.6.0

func (d *IncrementalDispatcher[T]) ForEach(fn func(T))

type OpsQueue

type OpsQueue struct {
	// contains filtered or unexported fields
}

func NewOpsQueue

func NewOpsQueue(params OpsQueueParams) *OpsQueue

func (*OpsQueue) Enqueue

func (oq *OpsQueue) Enqueue(op T)

func (*OpsQueue) Start

func (oq *OpsQueue) Start()

func (*OpsQueue) Stop

func (oq *OpsQueue) Stop() <-chan struct{}

type OpsQueueParams added in v1.6.0

type OpsQueueParams struct {
	Name        string
	MinSize     uint
	FlushOnStop bool
	Logger      logger.Logger
}

type TypedOpsQueue added in v1.6.1

type TypedOpsQueue[T any] struct {
	// contains filtered or unexported fields
}

func NewTypedOpsQueue added in v1.6.1

func NewTypedOpsQueue[T any](params OpsQueueParams) *TypedOpsQueue[T]

func (*TypedOpsQueue[T]) Enqueue added in v1.6.1

func (oq *TypedOpsQueue[T]) Enqueue(fn func(T), arg T)

func (*TypedOpsQueue) Start added in v1.6.1

func (oq *TypedOpsQueue) Start()

func (*TypedOpsQueue) Stop added in v1.6.1

func (oq *TypedOpsQueue) Stop() <-chan struct{}

type UntypedQueueOp added in v1.6.1

type UntypedQueueOp func()

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL