Documentation
¶
Index ¶
- Constants
- Variables
- func AppendLogFields(ctx context.Context, fields ...any)
- func AugmentClientInfo(ci *livekit.ClientInfo, req *http.Request)
- func DecompressGzip(compressed []byte) ([]byte, error)
- func DeterministicID(prefix, requestID string) string
- func DispatchAgentWorkerSignal(c agent.SignalConn, h agent.WorkerSignalHandler, l logger.Logger) bool
- func EgressID(ctx context.Context) (string, bool)
- func EnsureAdminPermission(ctx context.Context, room livekit.RoomName) error
- func EnsureCreatePermission(ctx context.Context) error
- func EnsureDestRoomPermission(ctx context.Context, source livekit.RoomName, destination livekit.RoomName) error
- func EnsureIngressAdminPermission(ctx context.Context) error
- func EnsureJoinPermission(ctx context.Context) (name livekit.RoomName, err error)
- func EnsureListPermission(ctx context.Context) error
- func EnsureRecordPermission(ctx context.Context) error
- func EnsureSIPAdminPermission(ctx context.Context) error
- func EnsureSIPCallPermission(ctx context.Context) error
- func GenBasicAuthMiddleware(username string, password string) func(http.ResponseWriter, *http.Request, http.HandlerFunc)
- func GetAPIKey(ctx context.Context) string
- func GetClientIP(r *http.Request) string
- func GetGrants(ctx context.Context) *auth.ClaimGrants
- func GetTokenExpiresAt(ctx context.Context) time.Time
- func HandleError(w http.ResponseWriter, r *http.Request, status int, err error, ...)
- func HandleErrorJson(w http.ResponseWriter, r *http.Request, status int, err error, ...)
- func HandshakeAgentWorker(c agent.SignalConn, serverInfo *livekit.ServerInfo, ...) (r agent.WorkerRegistration, ok bool)
- func InitializeRouter(conf *config.Config, currentNode routing.LocalNode) (routing.Router, error)
- func IsAgentPath(path string) bool
- func IsAgentWorkerPath(path string) bool
- func IsRTCPath(path string) bool
- func IsRTCValidatePath(path string) bool
- func IsValidDomain(domain string) bool
- func IsWebSocketCloseError(err error) bool
- func ListSIPDispatchRule(ctx context.Context, s SIPStore, req *livekit.ListSIPDispatchRuleRequest, ...) (iters.Iter[*livekit.SIPDispatchRuleInfo], error)
- func ListSIPInboundTrunk(ctx context.Context, s SIPStore, req *livekit.ListSIPInboundTrunkRequest, ...) (iters.Iter[*livekit.SIPInboundTrunkInfo], error)
- func ListSIPOutboundTrunk(ctx context.Context, s SIPStore, req *livekit.ListSIPOutboundTrunkRequest, ...) (iters.Iter[*livekit.SIPOutboundTrunkInfo], error)
- func NewEgressLauncher(client rpc.EgressClient, io IOClient, store ServiceStore) rtc.EgressLauncher
- func NewTurnServer(conf *config.Config, authHandler turn.AuthHandler, standalone bool) (*turn.Server, error)
- func ParseClientInfo(r *http.Request) *livekit.ClientInfo
- func RecordRequest(ctx context.Context, request proto.Message)
- func RecordResponse(ctx context.Context, response proto.Message)
- func RemoveDoubleSlashes(w http.ResponseWriter, r *http.Request, next http.HandlerFunc)
- func RequestID(ctx context.Context) string
- func SetAuthorizationToken(r *http.Request, token string)
- func SetRoomConfiguration(createRequest *livekit.CreateRoomRequest, conf *livekit.RoomConfiguration)
- func TwirpEgressID() *twirp.ServerHooks
- func TwirpLogger() *twirp.ServerHooks
- func TwirpRequestStatusReporter() *twirp.ServerHooks
- func TwirpTelemetry(nodeID livekit.NodeID, getProjectID func(ctx context.Context) string, ...) *twirp.ServerHooks
- func WithAPIKey(ctx context.Context, grants *auth.ClaimGrants, apiKey string) context.Context
- func WithEgressID(ctx context.Context, egressID string) context.Context
- func WithGrants(ctx context.Context, grants *auth.ClaimGrants, apiKey string) context.Context
- func WithGrantsExpiry(ctx context.Context, grants *auth.ClaimGrants, apiKey string, ...) context.Context
- func WithRequestID(ctx context.Context, id string) context.Context
- type APIKeyAuthMiddleware
- type AgentDispatchService
- func (ag *AgentDispatchService) CreateDispatch(ctx context.Context, req *livekit.CreateAgentDispatchRequest) (*livekit.AgentDispatch, error)
- func (ag *AgentDispatchService) DeleteDispatch(ctx context.Context, req *livekit.DeleteAgentDispatchRequest) (*livekit.AgentDispatch, error)
- func (ag *AgentDispatchService) ListDispatch(ctx context.Context, req *livekit.ListAgentDispatchRequest) (*livekit.ListAgentDispatchResponse, error)
- type AgentHandler
- func (h *AgentHandler) CheckEnabled(ctx context.Context, req *rpc.CheckEnabledRequest) (*rpc.CheckEnabledResponse, error)
- func (h *AgentHandler) DrainConnections(interval time.Duration, force bool)
- func (h *AgentHandler) HandleConnection(ctx context.Context, conn agent.SignalConn, ...)
- func (h *AgentHandler) JobRequest(ctx context.Context, job *livekit.Job) (*rpc.JobRequestResponse, error)
- func (h *AgentHandler) JobRequestAffinity(ctx context.Context, job *livekit.Job) float32
- func (h *AgentHandler) JobTerminate(ctx context.Context, req *rpc.JobTerminateRequest) (*rpc.JobTerminateResponse, error)
- type AgentService
- type AgentSocketUpgrader
- type AgentStore
- type EgressService
- func (s *EgressService) ListEgress(ctx context.Context, req *livekit.ListEgressRequest) (*livekit.ListEgressResponse, error)
- func (s *EgressService) StartEgress(ctx context.Context, req *livekit.StartEgressRequest) (*livekit.EgressInfo, error)
- func (s *EgressService) StartParticipantEgress(ctx context.Context, req *livekit.ParticipantEgressRequest) (*livekit.EgressInfo, error)
- func (s *EgressService) StartRoomCompositeEgress(ctx context.Context, req *livekit.RoomCompositeEgressRequest) (*livekit.EgressInfo, error)
- func (s *EgressService) StartTrackCompositeEgress(ctx context.Context, req *livekit.TrackCompositeEgressRequest) (*livekit.EgressInfo, error)
- func (s *EgressService) StartTrackEgress(ctx context.Context, req *livekit.TrackEgressRequest) (*livekit.EgressInfo, error)
- func (s *EgressService) StartWebEgress(ctx context.Context, req *livekit.WebEgressRequest) (*livekit.EgressInfo, error)
- func (s *EgressService) StopEgress(ctx context.Context, req *livekit.StopEgressRequest) (info *livekit.EgressInfo, err error)
- func (s *EgressService) UpdateLayout(ctx context.Context, req *livekit.UpdateLayoutRequest) (*livekit.EgressInfo, error)
- func (s *EgressService) UpdateStream(ctx context.Context, req *livekit.UpdateStreamRequest) (*livekit.EgressInfo, error)
- type EgressStore
- type IOClient
- type IOInfoService
- func (s *IOInfoService) CreateEgress(ctx context.Context, info *livekit.EgressInfo) (*emptypb.Empty, error)
- func (s *IOInfoService) CreateIngress(ctx context.Context, info *livekit.IngressInfo) (*rpc.CreateIngressResponse, error)
- func (s *IOInfoService) EvaluateSIPDispatchRules(ctx context.Context, req *rpc.EvaluateSIPDispatchRulesRequest) (*rpc.EvaluateSIPDispatchRulesResponse, error)
- func (s *IOInfoService) GetEgress(ctx context.Context, req *rpc.GetEgressRequest) (*livekit.EgressInfo, error)
- func (s *IOInfoService) GetIngressInfo(ctx context.Context, req *rpc.GetIngressInfoRequest) (*rpc.GetIngressInfoResponse, error)
- func (s *IOInfoService) GetSIPTrunkAuthentication(ctx context.Context, req *rpc.GetSIPTrunkAuthenticationRequest) (*rpc.GetSIPTrunkAuthenticationResponse, error)
- func (s *IOInfoService) ListEgress(ctx context.Context, req *livekit.ListEgressRequest) (*livekit.ListEgressResponse, error)
- func (s *IOInfoService) RecordCallContext(context.Context, *rpc.RecordCallContextRequest) (*emptypb.Empty, error)
- func (s *IOInfoService) SelectSIPDispatchRule(ctx context.Context, trunkID string) iters.Iter[*livekit.SIPDispatchRuleInfo]
- func (s *IOInfoService) SelectSIPInboundTrunk(ctx context.Context, called string) iters.Iter[*livekit.SIPInboundTrunkInfo]
- func (s *IOInfoService) Start() error
- func (s *IOInfoService) Stop()
- func (s *IOInfoService) UpdateEgress(ctx context.Context, info *livekit.EgressInfo) (*emptypb.Empty, error)
- func (s *IOInfoService) UpdateIngressState(ctx context.Context, req *rpc.UpdateIngressStateRequest) (*emptypb.Empty, error)
- func (s *IOInfoService) UpdateMetrics(ctx context.Context, req *rpc.UpdateMetricsRequest) (*emptypb.Empty, error)
- func (s *IOInfoService) UpdateSIPCallState(ctx context.Context, req *rpc.UpdateSIPCallStateRequest) (*emptypb.Empty, error)
- type IngressLauncher
- type IngressService
- func (s *IngressService) CreateIngress(ctx context.Context, req *livekit.CreateIngressRequest) (*livekit.IngressInfo, error)
- func (s *IngressService) CreateIngressWithUrl(ctx context.Context, urlStr string, req *livekit.CreateIngressRequest) (*livekit.IngressInfo, error)
- func (s *IngressService) DeleteIngress(ctx context.Context, req *livekit.DeleteIngressRequest) (*livekit.IngressInfo, error)
- func (s *IngressService) LaunchPullIngress(ctx context.Context, info *livekit.IngressInfo) (*livekit.IngressInfo, error)
- func (s *IngressService) ListIngress(ctx context.Context, req *livekit.ListIngressRequest) (*livekit.ListIngressResponse, error)
- func (s *IngressService) UpdateIngress(ctx context.Context, req *livekit.UpdateIngressRequest) (*livekit.IngressInfo, error)
- type IngressStore
- type LayoutMetadata
- type LivekitServer
- type LocalStore
- func (s *LocalStore) DeleteAgentDispatch(ctx context.Context, dispatch *livekit.AgentDispatch) error
- func (s *LocalStore) DeleteAgentJob(ctx context.Context, job *livekit.Job) error
- func (s *LocalStore) DeleteParticipant(_ context.Context, roomName livekit.RoomName, ...) error
- func (s *LocalStore) DeleteRoom(ctx context.Context, roomName livekit.RoomName) error
- func (s *LocalStore) HasParticipant(ctx context.Context, roomName livekit.RoomName, ...) (bool, error)
- func (s *LocalStore) ListAgentDispatches(ctx context.Context, roomName livekit.RoomName) ([]*livekit.AgentDispatch, error)
- func (s *LocalStore) ListParticipants(_ context.Context, roomName livekit.RoomName) ([]*livekit.ParticipantInfo, error)
- func (s *LocalStore) ListRooms(_ context.Context, roomNames []livekit.RoomName) ([]*livekit.Room, error)
- func (s *LocalStore) LoadParticipant(_ context.Context, roomName livekit.RoomName, ...) (*livekit.ParticipantInfo, error)
- func (s *LocalStore) LoadRoom(_ context.Context, roomName livekit.RoomName, includeInternal bool) (*livekit.Room, *livekit.RoomInternal, error)
- func (s *LocalStore) LockRoom(_ context.Context, _ livekit.RoomName, _ time.Duration) (string, error)
- func (s *LocalStore) RoomExists(ctx context.Context, roomName livekit.RoomName) (bool, error)
- func (s *LocalStore) StoreAgentDispatch(ctx context.Context, dispatch *livekit.AgentDispatch) error
- func (s *LocalStore) StoreAgentJob(ctx context.Context, job *livekit.Job) error
- func (s *LocalStore) StoreParticipant(_ context.Context, roomName livekit.RoomName, ...) error
- func (s *LocalStore) StoreRoom(_ context.Context, room *livekit.Room, internal *livekit.RoomInternal) error
- func (s *LocalStore) UnlockRoom(_ context.Context, _ livekit.RoomName, _ string) error
- type OSSServiceStore
- type ObjectStore
- type RTCService
- type RedisStore
- func (s *RedisStore) CleanEndedEgress() error
- func (s *RedisStore) DeleteAgentDispatch(_ context.Context, dispatch *livekit.AgentDispatch) error
- func (s *RedisStore) DeleteAgentJob(_ context.Context, job *livekit.Job) error
- func (s *RedisStore) DeleteIngress(_ context.Context, info *livekit.IngressInfo) error
- func (s *RedisStore) DeleteParticipant(_ context.Context, roomName livekit.RoomName, ...) error
- func (s *RedisStore) DeleteRoom(ctx context.Context, roomName livekit.RoomName) error
- func (s *RedisStore) DeleteSIPDispatchRule(ctx context.Context, sipDispatchRuleId string) error
- func (s *RedisStore) DeleteSIPTrunk(ctx context.Context, id string) error
- func (s *RedisStore) HasParticipant(ctx context.Context, roomName livekit.RoomName, ...) (bool, error)
- func (s *RedisStore) ListAgentDispatches(_ context.Context, roomName livekit.RoomName) ([]*livekit.AgentDispatch, error)
- func (s *RedisStore) ListEgress(_ context.Context, roomName livekit.RoomName, active bool) ([]*livekit.EgressInfo, error)
- func (s *RedisStore) ListIngress(_ context.Context, roomName livekit.RoomName) ([]*livekit.IngressInfo, error)
- func (s *RedisStore) ListParticipants(_ context.Context, roomName livekit.RoomName) ([]*livekit.ParticipantInfo, error)
- func (s *RedisStore) ListRooms(_ context.Context, roomNames []livekit.RoomName) ([]*livekit.Room, error)
- func (s *RedisStore) ListSIPDispatchRule(ctx context.Context, req *livekit.ListSIPDispatchRuleRequest) (*livekit.ListSIPDispatchRuleResponse, error)
- func (s *RedisStore) ListSIPInboundTrunk(ctx context.Context, req *livekit.ListSIPInboundTrunkRequest) (*livekit.ListSIPInboundTrunkResponse, error)
- func (s *RedisStore) ListSIPOutboundTrunk(ctx context.Context, req *livekit.ListSIPOutboundTrunkRequest) (*livekit.ListSIPOutboundTrunkResponse, error)
- func (s *RedisStore) ListSIPTrunk(ctx context.Context, req *livekit.ListSIPTrunkRequest) (*livekit.ListSIPTrunkResponse, error)
- func (s *RedisStore) LoadEgress(_ context.Context, egressID string) (*livekit.EgressInfo, error)
- func (s *RedisStore) LoadIngress(_ context.Context, ingressId string) (*livekit.IngressInfo, error)
- func (s *RedisStore) LoadIngressFromStreamKey(_ context.Context, streamKey string) (*livekit.IngressInfo, error)
- func (s *RedisStore) LoadParticipant(_ context.Context, roomName livekit.RoomName, ...) (*livekit.ParticipantInfo, error)
- func (s *RedisStore) LoadRoom(_ context.Context, roomName livekit.RoomName, includeInternal bool) (*livekit.Room, *livekit.RoomInternal, error)
- func (s *RedisStore) LoadSIPDispatchRule(ctx context.Context, sipDispatchRuleId string) (*livekit.SIPDispatchRuleInfo, error)
- func (s *RedisStore) LoadSIPInboundTrunk(ctx context.Context, id string) (*livekit.SIPInboundTrunkInfo, error)
- func (s *RedisStore) LoadSIPOutboundTrunk(ctx context.Context, id string) (*livekit.SIPOutboundTrunkInfo, error)
- func (s *RedisStore) LoadSIPTrunk(ctx context.Context, id string) (*livekit.SIPTrunkInfo, error)
- func (s *RedisStore) LockRoom(_ context.Context, roomName livekit.RoomName, duration time.Duration) (string, error)
- func (s *RedisStore) RoomExists(ctx context.Context, roomName livekit.RoomName) (bool, error)
- func (s *RedisStore) Start() error
- func (s *RedisStore) Stop()
- func (s *RedisStore) StoreAgentDispatch(_ context.Context, dispatch *livekit.AgentDispatch) error
- func (s *RedisStore) StoreAgentJob(_ context.Context, job *livekit.Job) error
- func (s *RedisStore) StoreEgress(_ context.Context, info *livekit.EgressInfo) error
- func (s *RedisStore) StoreIngress(ctx context.Context, info *livekit.IngressInfo) error
- func (s *RedisStore) StoreParticipant(_ context.Context, roomName livekit.RoomName, ...) error
- func (s *RedisStore) StoreRoom(_ context.Context, room *livekit.Room, internal *livekit.RoomInternal) error
- func (s *RedisStore) StoreSIPDispatchRule(ctx context.Context, info *livekit.SIPDispatchRuleInfo) error
- func (s *RedisStore) StoreSIPInboundTrunk(ctx context.Context, info *livekit.SIPInboundTrunkInfo) error
- func (s *RedisStore) StoreSIPOutboundTrunk(ctx context.Context, info *livekit.SIPOutboundTrunkInfo) error
- func (s *RedisStore) StoreSIPTrunk(ctx context.Context, info *livekit.SIPTrunkInfo) error
- func (s *RedisStore) UnlockRoom(_ context.Context, roomName livekit.RoomName, uid string) error
- func (s *RedisStore) UpdateEgress(_ context.Context, info *livekit.EgressInfo) error
- func (s *RedisStore) UpdateIngress(ctx context.Context, info *livekit.IngressInfo) error
- func (s *RedisStore) UpdateIngressState(ctx context.Context, ingressId string, state *livekit.IngressState) error
- type RequestBodyLimiter
- type RoomAllocator
- type RoomManager
- func (r *RoomManager) CloseIdleRooms()
- func (r *RoomManager) CreateDispatch(ctx context.Context, req *livekit.AgentDispatch) (*livekit.AgentDispatch, error)
- func (r *RoomManager) CreateRoom(ctx context.Context, req *livekit.CreateRoomRequest) (*livekit.Room, error)
- func (r *RoomManager) DeleteDispatch(ctx context.Context, req *livekit.DeleteAgentDispatchRequest) (*livekit.AgentDispatch, error)
- func (r *RoomManager) DeleteRoom(ctx context.Context, req *livekit.DeleteRoomRequest) (*livekit.DeleteRoomResponse, error)
- func (r *RoomManager) ForwardParticipant(ctx context.Context, req *livekit.ForwardParticipantRequest) (*livekit.ForwardParticipantResponse, error)
- func (r *RoomManager) GetParticipant(ctx context.Context, req *livekit.RoomParticipantIdentity) (*livekit.ParticipantInfo, error)
- func (r *RoomManager) GetRoom(_ context.Context, roomName livekit.RoomName) *rtc.Room
- func (r *RoomManager) HasParticipants() bool
- func (r *RoomManager) ListDispatch(ctx context.Context, req *livekit.ListAgentDispatchRequest) (*livekit.ListAgentDispatchResponse, error)
- func (r *RoomManager) ListParticipants(ctx context.Context, req *livekit.ListParticipantsRequest) (*livekit.ListParticipantsResponse, error)
- func (r *RoomManager) MoveParticipant(ctx context.Context, req *livekit.MoveParticipantRequest) (*livekit.MoveParticipantResponse, error)
- func (r *RoomManager) MutePublishedTrack(ctx context.Context, req *livekit.MuteRoomTrackRequest) (*livekit.MuteRoomTrackResponse, error)
- func (r *RoomManager) PerformRpc(ctx context.Context, req *livekit.PerformRpcRequest) (*livekit.PerformRpcResponse, error)
- func (r *RoomManager) RemoveParticipant(ctx context.Context, req *livekit.RoomParticipantIdentity) (*livekit.RemoveParticipantResponse, error)
- func (r *RoomManager) SendData(ctx context.Context, req *livekit.SendDataRequest) (*livekit.SendDataResponse, error)
- func (r *RoomManager) StartSession(ctx context.Context, pi routing.ParticipantInit, ...) error
- func (r *RoomManager) Stop()
- func (r *RoomManager) UpdateParticipant(ctx context.Context, req *livekit.UpdateParticipantRequest) (*livekit.ParticipantInfo, error)
- func (r *RoomManager) UpdateRoomMetadata(ctx context.Context, req *livekit.UpdateRoomMetadataRequest) (*livekit.Room, error)
- func (r *RoomManager) UpdateSubscriptions(ctx context.Context, req *livekit.UpdateSubscriptionsRequest) (*livekit.UpdateSubscriptionsResponse, error)
- type RoomService
- func (s *RoomService) CreateRoom(ctx context.Context, req *livekit.CreateRoomRequest) (*livekit.Room, error)
- func (s *RoomService) DeleteRoom(ctx context.Context, req *livekit.DeleteRoomRequest) (*livekit.DeleteRoomResponse, error)
- func (s *RoomService) ForwardParticipant(ctx context.Context, req *livekit.ForwardParticipantRequest) (*livekit.ForwardParticipantResponse, error)
- func (s *RoomService) GetParticipant(ctx context.Context, req *livekit.RoomParticipantIdentity) (participant *livekit.ParticipantInfo, err error)
- func (s *RoomService) ListParticipants(ctx context.Context, req *livekit.ListParticipantsRequest) (res *livekit.ListParticipantsResponse, err error)
- func (s *RoomService) ListRooms(ctx context.Context, req *livekit.ListRoomsRequest) (*livekit.ListRoomsResponse, error)
- func (s *RoomService) MoveParticipant(ctx context.Context, req *livekit.MoveParticipantRequest) (*livekit.MoveParticipantResponse, error)
- func (s *RoomService) MutePublishedTrack(ctx context.Context, req *livekit.MuteRoomTrackRequest) (*livekit.MuteRoomTrackResponse, error)
- func (s *RoomService) PerformRpc(ctx context.Context, req *livekit.PerformRpcRequest) (*livekit.PerformRpcResponse, error)
- func (s *RoomService) RemoveParticipant(ctx context.Context, req *livekit.RoomParticipantIdentity) (*livekit.RemoveParticipantResponse, error)
- func (s *RoomService) SendData(ctx context.Context, req *livekit.SendDataRequest) (*livekit.SendDataResponse, error)
- func (s *RoomService) UpdateParticipant(ctx context.Context, req *livekit.UpdateParticipantRequest) (*livekit.ParticipantInfo, error)
- func (s *RoomService) UpdateRoomMetadata(ctx context.Context, req *livekit.UpdateRoomMetadataRequest) (*livekit.Room, error)
- func (s *RoomService) UpdateSubscriptions(ctx context.Context, req *livekit.UpdateSubscriptionsRequest) (*livekit.UpdateSubscriptionsResponse, error)
- type SIPService
- func (s *SIPService) CreateSIPDispatchRule(ctx context.Context, req *livekit.CreateSIPDispatchRuleRequest) (*livekit.SIPDispatchRuleInfo, error)
- func (s *SIPService) CreateSIPInboundTrunk(ctx context.Context, req *livekit.CreateSIPInboundTrunkRequest) (*livekit.SIPInboundTrunkInfo, error)
- func (s *SIPService) CreateSIPOutboundTrunk(ctx context.Context, req *livekit.CreateSIPOutboundTrunkRequest) (*livekit.SIPOutboundTrunkInfo, error)
- func (s *SIPService) CreateSIPParticipant(ctx context.Context, req *livekit.CreateSIPParticipantRequest) (*livekit.SIPParticipantInfo, error)
- func (s *SIPService) CreateSIPParticipantRequest(ctx context.Context, req *livekit.CreateSIPParticipantRequest, ...) (*rpc.InternalCreateSIPParticipantRequest, error)
- func (s *SIPService) CreateSIPTrunk(ctx context.Context, req *livekit.CreateSIPTrunkRequest) (*livekit.SIPTrunkInfo, error)
- func (s *SIPService) DeleteSIPDispatchRule(ctx context.Context, req *livekit.DeleteSIPDispatchRuleRequest) (*livekit.SIPDispatchRuleInfo, error)
- func (s *SIPService) DeleteSIPTrunk(ctx context.Context, req *livekit.DeleteSIPTrunkRequest) (*livekit.SIPTrunkInfo, error)
- func (s *SIPService) GetSIPInboundTrunk(ctx context.Context, req *livekit.GetSIPInboundTrunkRequest) (*livekit.GetSIPInboundTrunkResponse, error)
- func (s *SIPService) GetSIPOutboundTrunk(ctx context.Context, req *livekit.GetSIPOutboundTrunkRequest) (*livekit.GetSIPOutboundTrunkResponse, error)
- func (s *SIPService) ListSIPDispatchRule(ctx context.Context, req *livekit.ListSIPDispatchRuleRequest) (*livekit.ListSIPDispatchRuleResponse, error)
- func (s *SIPService) ListSIPInboundTrunk(ctx context.Context, req *livekit.ListSIPInboundTrunkRequest) (*livekit.ListSIPInboundTrunkResponse, error)
- func (s *SIPService) ListSIPOutboundTrunk(ctx context.Context, req *livekit.ListSIPOutboundTrunkRequest) (*livekit.ListSIPOutboundTrunkResponse, error)
- func (s *SIPService) ListSIPTrunk(ctx context.Context, req *livekit.ListSIPTrunkRequest) (*livekit.ListSIPTrunkResponse, error)
- func (s *SIPService) TransferSIPParticipant(ctx context.Context, req *livekit.TransferSIPParticipantRequest) (*livekit.TransferSIPParticipantResponse, error)
- func (s *SIPService) UpdateSIPDispatchRule(ctx context.Context, req *livekit.UpdateSIPDispatchRuleRequest) (*livekit.SIPDispatchRuleInfo, error)
- func (s *SIPService) UpdateSIPInboundTrunk(ctx context.Context, req *livekit.UpdateSIPInboundTrunkRequest) (*livekit.SIPInboundTrunkInfo, error)
- func (s *SIPService) UpdateSIPOutboundTrunk(ctx context.Context, req *livekit.UpdateSIPOutboundTrunkRequest) (*livekit.SIPOutboundTrunkInfo, error)
- type SIPStore
- type ServiceStore
- type SessionHandler
- type SignalServer
- type StandardRoomAllocator
- func (r *StandardRoomAllocator) AutoCreateEnabled(context.Context) bool
- func (r *StandardRoomAllocator) CreateRoom(ctx context.Context, req *livekit.CreateRoomRequest, isExplicit bool) (*livekit.Room, *livekit.RoomInternal, bool, error)
- func (r *StandardRoomAllocator) SelectRoomNode(ctx context.Context, roomName livekit.RoomName, nodeID livekit.NodeID) error
- func (r *StandardRoomAllocator) ValidateCreateRoom(ctx context.Context, roomName livekit.RoomName) error
- type TURNAuthHandler
- func (h *TURNAuthHandler) CreatePassword(apiKey string, pID livekit.ParticipantID, expiry int64) (string, error)
- func (h *TURNAuthHandler) CreateUsername(apiKey string, pID livekit.ParticipantID, ttlSeconds int) (string, int64)
- func (h *TURNAuthHandler) HandleAuth(ra *turn.RequestAttributes) (userID string, key []byte, ok bool)
- func (h *TURNAuthHandler) ParseUsername(username string) (string, livekit.ParticipantID, int64, error)
- type ValidateConnectRequestParams
- type ValidateConnectRequestResult
- type WHIPService
- type WSSignalConnection
- func (c *WSSignalConnection) Close() error
- func (c *WSSignalConnection) CloseWithReason(reason string) error
- func (c *WSSignalConnection) ReadRequest() (*livekit.SignalRequest, int, error)
- func (c *WSSignalConnection) ReadWorkerMessage() (*livekit.WorkerMessage, int, error)
- func (c *WSSignalConnection) SetReadDeadline(deadline time.Time) error
- func (c *WSSignalConnection) WriteResponse(msg *livekit.SignalResponse) (int, error)
- func (c *WSSignalConnection) WriteServerMessage(msg *livekit.ServerMessage) (int, error)
Constants ¶
const ( VersionKey = "livekit_version" // RoomsKey is hash of room_name => Room proto RoomsKey = "rooms" RoomInternalKey = "room_internal" // EgressKey is a hash of egressID => egress info EgressKey = "egress" EndedEgressKey = "ended_egress" RoomEgressPrefix = "egress:room:" // IngressKey is a hash of ingressID => ingress info IngressKey = "ingress" StreamKeyKey = "{ingress}_stream_key" IngressStatePrefix = "{ingress}_state:" RoomIngressPrefix = "room_{ingress}:" // RoomParticipantsPrefix is hash of participant_name => ParticipantInfo RoomParticipantsPrefix = "room_participants:" // RoomLockPrefix is a simple key containing a provided lock uid RoomLockPrefix = "room_lock:" // Agents AgentDispatchPrefix = "agent_dispatch:" AgentJobPrefix = "agent_job:" )
const ( SIPTrunkKey = "sip_trunk" SIPInboundTrunkKey = "sip_inbound_trunk" SIPOutboundTrunkKey = "sip_outbound_trunk" SIPDispatchRuleKey = "sip_dispatch_rule" )
const (
LivekitRealm = "livekit"
)
const RequestIDAttribute = "lk.request_id"
RequestIDAttribute is the participant attribute stamped with the request id for calls that join a room before dialing. A retry finds the existing participant with a matching value and skips the dial.
Variables ¶
var ( ErrPermissionDenied = errors.New("permissions denied") ErrMissingAuthorization = errors.New("invalid authorization header. Must start with " + bearerPrefix) ErrInvalidAuthorizationToken = errors.New("invalid authorization token") ErrInvalidAPIKey = errors.New("invalid API key") )
var ( ErrEgressNotFound = psrpc.NewErrorf(psrpc.NotFound, "egress does not exist") ErrEgressNotConnected = psrpc.NewErrorf(psrpc.Internal, "egress not connected (redis required)") ErrIdentityEmpty = psrpc.NewErrorf(psrpc.InvalidArgument, "identity cannot be empty") ErrParticipantSidEmpty = psrpc.NewErrorf(psrpc.InvalidArgument, "participant sid cannot be empty") ErrIngressNotConnected = psrpc.NewErrorf(psrpc.Internal, "ingress not connected (redis required)") ErrIngressNotFound = psrpc.NewErrorf(psrpc.NotFound, "ingress does not exist") ErrIngressNonReusable = psrpc.NewErrorf(psrpc.InvalidArgument, "ingress is not reusable and cannot be modified") ErrNameExceedsLimits = psrpc.NewErrorf(psrpc.InvalidArgument, "name length exceeds limits") ErrMetadataExceedsLimits = psrpc.NewErrorf(psrpc.InvalidArgument, "metadata size exceeds limits") ErrAttributeExceedsLimits = psrpc.NewErrorf(psrpc.InvalidArgument, "attribute size exceeds limits") ErrNoRoomName = psrpc.NewErrorf(psrpc.InvalidArgument, "no room name") ErrRoomNameExceedsLimits = psrpc.NewErrorf(psrpc.InvalidArgument, "room name length exceeds limits") ErrParticipantIdentityExceedsLimits = psrpc.NewErrorf(psrpc.InvalidArgument, "participant identity length exceeds limits") ErrDestinationSameAsSourceRoom = psrpc.NewErrorf(psrpc.InvalidArgument, "destination room cannot be the same as source room") ErrOperationFailed = psrpc.NewErrorf(psrpc.Internal, "operation cannot be completed") ErrParticipantNotFound = psrpc.NewErrorf(psrpc.NotFound, "participant does not exist") ErrRoomNotFound = psrpc.NewErrorf(psrpc.NotFound, "requested room does not exist") ErrRoomLockFailed = psrpc.NewErrorf(psrpc.Internal, "could not lock room") ErrRoomUnlockFailed = psrpc.NewErrorf(psrpc.Internal, "could not unlock room, lock token does not match") ErrRemoteUnmuteNoteEnabled = psrpc.NewErrorf(psrpc.FailedPrecondition, "remote unmute not enabled") ErrTrackNotFound = psrpc.NewErrorf(psrpc.NotFound, "track is not found") ErrWebHookMissingAPIKey = psrpc.NewErrorf(psrpc.InvalidArgument, "api_key is required to use webhooks") ErrSIPNotConnected = psrpc.NewErrorf(psrpc.Internal, "sip not connected (redis required)") ErrSIPTrunkNotFound = psrpc.NewErrorf(psrpc.NotFound, "requested sip trunk does not exist") ErrSIPDispatchRuleNotFound = psrpc.NewErrorf(psrpc.NotFound, "requested sip dispatch rule does not exist") ErrSIPParticipantNotFound = psrpc.NewErrorf(psrpc.NotFound, "requested sip participant does not exist") ErrInvalidMessageType = psrpc.NewErrorf(psrpc.Internal, "invalid message type") ErrNoConnectRequest = psrpc.NewErrorf(psrpc.InvalidArgument, "no connect request") ErrNoConnectResponse = psrpc.NewErrorf(psrpc.InvalidArgument, "no connect response") ErrDestinationIdentityRequired = psrpc.NewErrorf(psrpc.InvalidArgument, "destination identity is required") )
var ( ErrGzipReadFailed = errors.New("cannot read decompressed data") ErrGzipTooLarge = errors.New("decompressed data too large") ErrRequestBodyTooLarge = errors.New("request body too large") )
var ErrExpired = errors.New("expired")
Functions ¶
func AppendLogFields ¶ added in v1.3.2
func AugmentClientInfo ¶ added in v1.9.1
func AugmentClientInfo(ci *livekit.ClientInfo, req *http.Request)
func DecompressGzip ¶ added in v1.11.0
func DeterministicID ¶ added in v1.13.6
DeterministicID derives a stable resource id from the request id — retries of the same logical call yield the same id and dedup at the store. With no request id it falls back to a random id.
func DispatchAgentWorkerSignal ¶ added in v1.8.0
func DispatchAgentWorkerSignal(c agent.SignalConn, h agent.WorkerSignalHandler, l logger.Logger) bool
func EnsureAdminPermission ¶
func EnsureCreatePermission ¶
func EnsureDestRoomPermission ¶ added in v1.9.0
func EnsureIngressAdminPermission ¶ added in v1.3.0
func EnsureJoinPermission ¶
func EnsureListPermission ¶
func EnsureRecordPermission ¶ added in v0.12.1
func EnsureSIPAdminPermission ¶ added in v1.6.3
func EnsureSIPCallPermission ¶ added in v1.6.3
func GenBasicAuthMiddleware ¶ added in v1.7.1
func GenBasicAuthMiddleware(username string, password string) func(http.ResponseWriter, *http.Request, http.HandlerFunc)
func GetClientIP ¶ added in v1.4.1
func HandleError ¶ added in v1.9.0
func HandleErrorJson ¶ added in v1.9.1
func HandshakeAgentWorker ¶ added in v1.8.0
func HandshakeAgentWorker(c agent.SignalConn, serverInfo *livekit.ServerInfo, registration agent.WorkerRegistration, l logger.Logger) (r agent.WorkerRegistration, ok bool)
func InitializeRouter ¶ added in v0.12.2
func IsAgentPath ¶ added in v1.10.1
func IsAgentWorkerPath ¶ added in v1.12.0
func IsRTCValidatePath ¶ added in v1.10.1
func IsValidDomain ¶ added in v0.12.2
func IsWebSocketCloseError ¶ added in v1.7.1
IsWebSocketCloseError checks that error is normal/expected closure
func ListSIPDispatchRule ¶ added in v1.8.4
func ListSIPDispatchRule(ctx context.Context, s SIPStore, req *livekit.ListSIPDispatchRuleRequest, add ...*livekit.SIPDispatchRuleInfo) (iters.Iter[*livekit.SIPDispatchRuleInfo], error)
func ListSIPInboundTrunk ¶ added in v1.8.4
func ListSIPInboundTrunk(ctx context.Context, s SIPStore, req *livekit.ListSIPInboundTrunkRequest, add ...*livekit.SIPInboundTrunkInfo) (iters.Iter[*livekit.SIPInboundTrunkInfo], error)
func ListSIPOutboundTrunk ¶ added in v1.8.4
func ListSIPOutboundTrunk(ctx context.Context, s SIPStore, req *livekit.ListSIPOutboundTrunkRequest, add ...*livekit.SIPOutboundTrunkInfo) (iters.Iter[*livekit.SIPOutboundTrunkInfo], error)
func NewEgressLauncher ¶ added in v1.2.2
func NewEgressLauncher(client rpc.EgressClient, io IOClient, store ServiceStore) rtc.EgressLauncher
func NewTurnServer ¶
func ParseClientInfo ¶ added in v0.15.3
func ParseClientInfo(r *http.Request) *livekit.ClientInfo
func RecordResponse ¶ added in v1.8.4
func RemoveDoubleSlashes ¶ added in v1.8.0
func RemoveDoubleSlashes(w http.ResponseWriter, r *http.Request, next http.HandlerFunc)
func SetAuthorizationToken ¶
func SetRoomConfiguration ¶ added in v1.8.1
func SetRoomConfiguration(createRequest *livekit.CreateRoomRequest, conf *livekit.RoomConfiguration)
func TwirpEgressID ¶ added in v1.9.12
func TwirpEgressID() *twirp.ServerHooks
func TwirpLogger ¶ added in v1.2.5
func TwirpLogger() *twirp.ServerHooks
logging handling inspired by https://github.com/bakins/twirpzap License: Apache-2.0
func TwirpRequestStatusReporter ¶ added in v1.3.4
func TwirpRequestStatusReporter() *twirp.ServerHooks
func TwirpTelemetry ¶ added in v1.8.4
func TwirpTelemetry( nodeID livekit.NodeID, getProjectID func(ctx context.Context) string, telemetry telemetry.TelemetryService, ) *twirp.ServerHooks
func WithAPIKey ¶ added in v1.8.0
func WithEgressID ¶ added in v1.9.12
func WithGrants ¶ added in v0.15.5
func WithGrantsExpiry ¶ added in v1.13.2
Types ¶
type APIKeyAuthMiddleware ¶
type APIKeyAuthMiddleware struct {
// contains filtered or unexported fields
}
authentication middleware
func NewAPIKeyAuthMiddleware ¶
func NewAPIKeyAuthMiddleware(provider auth.KeyProvider) *APIKeyAuthMiddleware
func (*APIKeyAuthMiddleware) ServeHTTP ¶
func (m *APIKeyAuthMiddleware) ServeHTTP(w http.ResponseWriter, r *http.Request, next http.HandlerFunc)
type AgentDispatchService ¶ added in v1.7.1
type AgentDispatchService struct {
// contains filtered or unexported fields
}
func NewAgentDispatchService ¶ added in v1.7.1
func NewAgentDispatchService( limitConf config.LimitConfig, agentDispatchClient rpc.TypedAgentDispatchInternalClient, topicFormatter rpc.TopicFormatter, roomAllocator RoomAllocator, router routing.MessageRouter, ) *AgentDispatchService
func (*AgentDispatchService) CreateDispatch ¶ added in v1.7.1
func (ag *AgentDispatchService) CreateDispatch(ctx context.Context, req *livekit.CreateAgentDispatchRequest) (*livekit.AgentDispatch, error)
func (*AgentDispatchService) DeleteDispatch ¶ added in v1.7.1
func (ag *AgentDispatchService) DeleteDispatch(ctx context.Context, req *livekit.DeleteAgentDispatchRequest) (*livekit.AgentDispatch, error)
func (*AgentDispatchService) ListDispatch ¶ added in v1.7.1
func (ag *AgentDispatchService) ListDispatch(ctx context.Context, req *livekit.ListAgentDispatchRequest) (*livekit.ListAgentDispatchResponse, error)
type AgentHandler ¶ added in v1.5.1
type AgentHandler struct {
// contains filtered or unexported fields
}
func NewAgentHandler ¶ added in v1.5.1
func NewAgentHandler( agentServer rpc.AgentInternalServer, keyProvider auth.KeyProvider, logger logger.Logger, serverInfo *livekit.ServerInfo, targetLoad float32, roomTopic string, publisherTopic string, participantTopic string, ) *AgentHandler
func (*AgentHandler) CheckEnabled ¶ added in v1.5.1
func (h *AgentHandler) CheckEnabled(ctx context.Context, req *rpc.CheckEnabledRequest) (*rpc.CheckEnabledResponse, error)
func (*AgentHandler) DrainConnections ¶ added in v1.5.1
func (h *AgentHandler) DrainConnections(interval time.Duration, force bool)
func (*AgentHandler) HandleConnection ¶ added in v1.5.1
func (h *AgentHandler) HandleConnection(ctx context.Context, conn agent.SignalConn, registration agent.WorkerRegistration)
func (*AgentHandler) JobRequest ¶ added in v1.5.1
func (h *AgentHandler) JobRequest(ctx context.Context, job *livekit.Job) (*rpc.JobRequestResponse, error)
func (*AgentHandler) JobRequestAffinity ¶ added in v1.5.1
func (*AgentHandler) JobTerminate ¶ added in v1.7.1
func (h *AgentHandler) JobTerminate(ctx context.Context, req *rpc.JobTerminateRequest) (*rpc.JobTerminateResponse, error)
type AgentService ¶ added in v1.5.1
type AgentService struct {
*AgentHandler
// contains filtered or unexported fields
}
func NewAgentService ¶ added in v1.5.1
func NewAgentService( conf *config.Config, currentNode routing.LocalNode, bus psrpc.MessageBus, keyProvider auth.KeyProvider, ) (*AgentService, error)
func (*AgentService) ServeHTTP ¶ added in v1.5.1
func (s *AgentService) ServeHTTP(w http.ResponseWriter, r *http.Request)
type AgentSocketUpgrader ¶ added in v1.7.1
func (AgentSocketUpgrader) Upgrade ¶ added in v1.7.1
func (u AgentSocketUpgrader) Upgrade( w http.ResponseWriter, r *http.Request, responseHeader http.Header, ) ( conn *websocket.Conn, registration agent.WorkerRegistration, ok bool, )
type AgentStore ¶ added in v1.7.1
type AgentStore interface {
StoreAgentDispatch(ctx context.Context, dispatch *livekit.AgentDispatch) error
DeleteAgentDispatch(ctx context.Context, dispatch *livekit.AgentDispatch) error
ListAgentDispatches(ctx context.Context, roomName livekit.RoomName) ([]*livekit.AgentDispatch, error)
StoreAgentJob(ctx context.Context, job *livekit.Job) error
DeleteAgentJob(ctx context.Context, job *livekit.Job) error
}
type EgressService ¶ added in v0.15.5
type EgressService struct {
// contains filtered or unexported fields
}
func NewEgressService ¶ added in v0.15.5
func NewEgressService( client rpc.EgressClient, launcher rtc.EgressLauncher, io IOClient, rs livekit.RoomService, ) *EgressService
func (*EgressService) ListEgress ¶ added in v0.15.5
func (s *EgressService) ListEgress(ctx context.Context, req *livekit.ListEgressRequest) (*livekit.ListEgressResponse, error)
func (*EgressService) StartEgress ¶ added in v0.15.5
func (s *EgressService) StartEgress(ctx context.Context, req *livekit.StartEgressRequest) (*livekit.EgressInfo, error)
func (*EgressService) StartParticipantEgress ¶ added in v1.5.0
func (s *EgressService) StartParticipantEgress(ctx context.Context, req *livekit.ParticipantEgressRequest) (*livekit.EgressInfo, error)
func (*EgressService) StartRoomCompositeEgress ¶ added in v0.15.7
func (s *EgressService) StartRoomCompositeEgress(ctx context.Context, req *livekit.RoomCompositeEgressRequest) (*livekit.EgressInfo, error)
func (*EgressService) StartTrackCompositeEgress ¶ added in v0.15.5
func (s *EgressService) StartTrackCompositeEgress(ctx context.Context, req *livekit.TrackCompositeEgressRequest) (*livekit.EgressInfo, error)
func (*EgressService) StartTrackEgress ¶ added in v0.15.5
func (s *EgressService) StartTrackEgress(ctx context.Context, req *livekit.TrackEgressRequest) (*livekit.EgressInfo, error)
func (*EgressService) StartWebEgress ¶ added in v1.3.0
func (s *EgressService) StartWebEgress(ctx context.Context, req *livekit.WebEgressRequest) (*livekit.EgressInfo, error)
func (*EgressService) StopEgress ¶ added in v0.15.5
func (s *EgressService) StopEgress(ctx context.Context, req *livekit.StopEgressRequest) (info *livekit.EgressInfo, err error)
func (*EgressService) UpdateLayout ¶ added in v0.15.5
func (s *EgressService) UpdateLayout(ctx context.Context, req *livekit.UpdateLayoutRequest) (*livekit.EgressInfo, error)
func (*EgressService) UpdateStream ¶ added in v0.15.5
func (s *EgressService) UpdateStream(ctx context.Context, req *livekit.UpdateStreamRequest) (*livekit.EgressInfo, error)
type EgressStore ¶ added in v0.15.5
type EgressStore interface {
StoreEgress(ctx context.Context, info *livekit.EgressInfo) error
LoadEgress(ctx context.Context, egressID string) (*livekit.EgressInfo, error)
ListEgress(ctx context.Context, roomName livekit.RoomName, active bool) ([]*livekit.EgressInfo, error)
UpdateEgress(ctx context.Context, info *livekit.EgressInfo) error
}
type IOClient ¶ added in v1.5.1
type IOClient interface {
CreateEgress(ctx context.Context, info *livekit.EgressInfo) (*emptypb.Empty, error)
GetEgress(ctx context.Context, req *rpc.GetEgressRequest) (*livekit.EgressInfo, error)
ListEgress(ctx context.Context, req *livekit.ListEgressRequest) (*livekit.ListEgressResponse, error)
CreateIngress(ctx context.Context, req *livekit.IngressInfo) (*rpc.CreateIngressResponse, error)
UpdateIngressState(ctx context.Context, req *rpc.UpdateIngressStateRequest) (*emptypb.Empty, error)
}
type IOInfoService ¶ added in v1.3.4
type IOInfoService struct {
// contains filtered or unexported fields
}
func NewIOInfoService ¶ added in v1.3.4
func NewIOInfoService( bus psrpc.MessageBus, es EgressStore, is IngressStore, ss SIPStore, ts telemetry.TelemetryService, ) (*IOInfoService, error)
func (*IOInfoService) CreateEgress ¶ added in v1.5.1
func (s *IOInfoService) CreateEgress(ctx context.Context, info *livekit.EgressInfo) (*emptypb.Empty, error)
func (*IOInfoService) CreateIngress ¶ added in v1.5.3
func (s *IOInfoService) CreateIngress(ctx context.Context, info *livekit.IngressInfo) (*rpc.CreateIngressResponse, error)
func (*IOInfoService) EvaluateSIPDispatchRules ¶ added in v1.5.2
func (s *IOInfoService) EvaluateSIPDispatchRules(ctx context.Context, req *rpc.EvaluateSIPDispatchRulesRequest) (*rpc.EvaluateSIPDispatchRulesResponse, error)
func (*IOInfoService) GetEgress ¶ added in v1.5.1
func (s *IOInfoService) GetEgress(ctx context.Context, req *rpc.GetEgressRequest) (*livekit.EgressInfo, error)
func (*IOInfoService) GetIngressInfo ¶ added in v1.3.4
func (s *IOInfoService) GetIngressInfo(ctx context.Context, req *rpc.GetIngressInfoRequest) (*rpc.GetIngressInfoResponse, error)
func (*IOInfoService) GetSIPTrunkAuthentication ¶ added in v1.5.2
func (s *IOInfoService) GetSIPTrunkAuthentication(ctx context.Context, req *rpc.GetSIPTrunkAuthenticationRequest) (*rpc.GetSIPTrunkAuthenticationResponse, error)
func (*IOInfoService) ListEgress ¶ added in v1.5.1
func (s *IOInfoService) ListEgress(ctx context.Context, req *livekit.ListEgressRequest) (*livekit.ListEgressResponse, error)
func (*IOInfoService) RecordCallContext ¶ added in v1.9.2
func (s *IOInfoService) RecordCallContext(context.Context, *rpc.RecordCallContextRequest) (*emptypb.Empty, error)
func (*IOInfoService) SelectSIPDispatchRule ¶ added in v1.8.4
func (s *IOInfoService) SelectSIPDispatchRule(ctx context.Context, trunkID string) iters.Iter[*livekit.SIPDispatchRuleInfo]
func (*IOInfoService) SelectSIPInboundTrunk ¶ added in v1.8.4
func (s *IOInfoService) SelectSIPInboundTrunk(ctx context.Context, called string) iters.Iter[*livekit.SIPInboundTrunkInfo]
func (*IOInfoService) Start ¶ added in v1.3.4
func (s *IOInfoService) Start() error
func (*IOInfoService) Stop ¶ added in v1.3.4
func (s *IOInfoService) Stop()
func (*IOInfoService) UpdateEgress ¶ added in v1.5.1
func (s *IOInfoService) UpdateEgress(ctx context.Context, info *livekit.EgressInfo) (*emptypb.Empty, error)
func (*IOInfoService) UpdateIngressState ¶ added in v1.3.4
func (s *IOInfoService) UpdateIngressState(ctx context.Context, req *rpc.UpdateIngressStateRequest) (*emptypb.Empty, error)
func (*IOInfoService) UpdateMetrics ¶ added in v1.5.2
func (s *IOInfoService) UpdateMetrics(ctx context.Context, req *rpc.UpdateMetricsRequest) (*emptypb.Empty, error)
func (*IOInfoService) UpdateSIPCallState ¶ added in v1.8.0
func (s *IOInfoService) UpdateSIPCallState(ctx context.Context, req *rpc.UpdateSIPCallStateRequest) (*emptypb.Empty, error)
type IngressLauncher ¶ added in v1.4.5
type IngressLauncher interface {
LaunchPullIngress(ctx context.Context, info *livekit.IngressInfo) (*livekit.IngressInfo, error)
}
type IngressService ¶ added in v1.2.0
type IngressService struct {
// contains filtered or unexported fields
}
func NewIngressService ¶ added in v1.2.0
func NewIngressService( conf *config.IngressConfig, nodeID livekit.NodeID, bus psrpc.MessageBus, psrpcClient rpc.IngressClient, store IngressStore, io IOClient, ts telemetry.TelemetryService, ) *IngressService
func NewIngressServiceWithIngressLauncher ¶ added in v1.4.5
func NewIngressServiceWithIngressLauncher( conf *config.IngressConfig, nodeID livekit.NodeID, bus psrpc.MessageBus, psrpcClient rpc.IngressClient, store IngressStore, io IOClient, ts telemetry.TelemetryService, launcher IngressLauncher, ) *IngressService
func (*IngressService) CreateIngress ¶ added in v1.2.0
func (s *IngressService) CreateIngress(ctx context.Context, req *livekit.CreateIngressRequest) (*livekit.IngressInfo, error)
func (*IngressService) CreateIngressWithUrl ¶ added in v1.4.5
func (s *IngressService) CreateIngressWithUrl(ctx context.Context, urlStr string, req *livekit.CreateIngressRequest) (*livekit.IngressInfo, error)
func (*IngressService) DeleteIngress ¶ added in v1.2.0
func (s *IngressService) DeleteIngress(ctx context.Context, req *livekit.DeleteIngressRequest) (*livekit.IngressInfo, error)
func (*IngressService) LaunchPullIngress ¶ added in v1.4.5
func (s *IngressService) LaunchPullIngress(ctx context.Context, info *livekit.IngressInfo) (*livekit.IngressInfo, error)
func (*IngressService) ListIngress ¶ added in v1.2.0
func (s *IngressService) ListIngress(ctx context.Context, req *livekit.ListIngressRequest) (*livekit.ListIngressResponse, error)
func (*IngressService) UpdateIngress ¶ added in v1.2.0
func (s *IngressService) UpdateIngress(ctx context.Context, req *livekit.UpdateIngressRequest) (*livekit.IngressInfo, error)
type IngressStore ¶ added in v1.2.0
type IngressStore interface {
StoreIngress(ctx context.Context, info *livekit.IngressInfo) error
LoadIngress(ctx context.Context, ingressID string) (*livekit.IngressInfo, error)
LoadIngressFromStreamKey(ctx context.Context, streamKey string) (*livekit.IngressInfo, error)
ListIngress(ctx context.Context, roomName livekit.RoomName) ([]*livekit.IngressInfo, error)
UpdateIngress(ctx context.Context, info *livekit.IngressInfo) error
UpdateIngressState(ctx context.Context, ingressId string, state *livekit.IngressState) error
DeleteIngress(ctx context.Context, info *livekit.IngressInfo) error
}
type LayoutMetadata ¶ added in v0.15.5
type LayoutMetadata struct {
Layout string `json:"layout"`
}
type LivekitServer ¶
type LivekitServer struct {
// contains filtered or unexported fields
}
func InitializeServer ¶
func NewLivekitServer ¶
func NewLivekitServer(conf *config.Config, roomService livekit.RoomService, agentDispatchService *AgentDispatchService, egressService *EgressService, ingressService *IngressService, sipService *SIPService, ioService *IOInfoService, rtcService *RTCService, whipService *WHIPService, agentService *AgentService, keyProvider auth.KeyProvider, router routing.Router, roomManager *RoomManager, signalServer *SignalServer, turnServer *turn.Server, currentNode routing.LocalNode, ) (s *LivekitServer, err error)
func (*LivekitServer) HTTPPort ¶ added in v0.15.3
func (s *LivekitServer) HTTPPort() int
func (*LivekitServer) IsRunning ¶
func (s *LivekitServer) IsRunning() bool
func (*LivekitServer) Node ¶
func (s *LivekitServer) Node() *livekit.Node
func (*LivekitServer) RoomManager ¶ added in v0.9.2
func (s *LivekitServer) RoomManager() *RoomManager
func (*LivekitServer) Start ¶
func (s *LivekitServer) Start() error
func (*LivekitServer) Stop ¶
func (s *LivekitServer) Stop(force bool)
type LocalStore ¶ added in v0.15.5
type LocalStore struct {
// contains filtered or unexported fields
}
encapsulates CRUD operations for room settings
func NewLocalStore ¶ added in v0.15.5
func NewLocalStore() *LocalStore
func (*LocalStore) DeleteAgentDispatch ¶ added in v1.7.1
func (s *LocalStore) DeleteAgentDispatch(ctx context.Context, dispatch *livekit.AgentDispatch) error
func (*LocalStore) DeleteAgentJob ¶ added in v1.7.1
func (*LocalStore) DeleteParticipant ¶ added in v0.15.5
func (s *LocalStore) DeleteParticipant(_ context.Context, roomName livekit.RoomName, identity livekit.ParticipantIdentity) error
func (*LocalStore) DeleteRoom ¶ added in v0.15.5
func (*LocalStore) HasParticipant ¶ added in v1.9.0
func (s *LocalStore) HasParticipant(ctx context.Context, roomName livekit.RoomName, identity livekit.ParticipantIdentity) (bool, error)
func (*LocalStore) ListAgentDispatches ¶ added in v1.7.1
func (s *LocalStore) ListAgentDispatches(ctx context.Context, roomName livekit.RoomName) ([]*livekit.AgentDispatch, error)
func (*LocalStore) ListParticipants ¶ added in v0.15.5
func (s *LocalStore) ListParticipants(_ context.Context, roomName livekit.RoomName) ([]*livekit.ParticipantInfo, error)
func (*LocalStore) LoadParticipant ¶ added in v0.15.5
func (s *LocalStore) LoadParticipant(_ context.Context, roomName livekit.RoomName, identity livekit.ParticipantIdentity) (*livekit.ParticipantInfo, error)
func (*LocalStore) RoomExists ¶ added in v1.9.10
func (*LocalStore) StoreAgentDispatch ¶ added in v1.7.1
func (s *LocalStore) StoreAgentDispatch(ctx context.Context, dispatch *livekit.AgentDispatch) error
func (*LocalStore) StoreAgentJob ¶ added in v1.7.1
func (*LocalStore) StoreParticipant ¶ added in v0.15.5
func (s *LocalStore) StoreParticipant(_ context.Context, roomName livekit.RoomName, participant *livekit.ParticipantInfo) error
func (*LocalStore) StoreRoom ¶ added in v0.15.5
func (s *LocalStore) StoreRoom(_ context.Context, room *livekit.Room, internal *livekit.RoomInternal) error
func (*LocalStore) UnlockRoom ¶ added in v0.15.5
type OSSServiceStore ¶ added in v1.9.0
type OSSServiceStore interface {
DeleteRoom(ctx context.Context, roomName livekit.RoomName) error
HasParticipant(context.Context, livekit.RoomName, livekit.ParticipantIdentity) (bool, error)
LoadParticipant(ctx context.Context, roomName livekit.RoomName, identity livekit.ParticipantIdentity) (*livekit.ParticipantInfo, error)
ListParticipants(ctx context.Context, roomName livekit.RoomName) ([]*livekit.ParticipantInfo, error)
}
type ObjectStore ¶ added in v0.15.5
type ObjectStore interface {
ServiceStore
OSSServiceStore
// enable locking on a specific room to prevent race
// returns a (lock uuid, error)
LockRoom(ctx context.Context, roomName livekit.RoomName, duration time.Duration) (string, error)
UnlockRoom(ctx context.Context, roomName livekit.RoomName, uid string) error
StoreRoom(ctx context.Context, room *livekit.Room, internal *livekit.RoomInternal) error
StoreParticipant(ctx context.Context, roomName livekit.RoomName, participant *livekit.ParticipantInfo) error
DeleteParticipant(ctx context.Context, roomName livekit.RoomName, identity livekit.ParticipantIdentity) error
}
encapsulates CRUD operations for room settings
type RTCService ¶
type RTCService struct {
// contains filtered or unexported fields
}
func NewRTCService ¶
func NewRTCService( conf *config.Config, ra RoomAllocator, router routing.MessageRouter, telemetry telemetry.TelemetryService, ) *RTCService
func (*RTCService) DrainConnections ¶ added in v1.4.4
func (s *RTCService) DrainConnections(interval time.Duration, force bool)
func (*RTCService) SetupRoutes ¶ added in v1.8.4
func (s *RTCService) SetupRoutes(mux *http.ServeMux)
type RedisStore ¶ added in v0.15.5
type RedisStore struct {
// contains filtered or unexported fields
}
func NewRedisStore ¶ added in v0.15.5
func NewRedisStore(rc redis.UniversalClient) *RedisStore
func (*RedisStore) CleanEndedEgress ¶ added in v1.2.0
func (s *RedisStore) CleanEndedEgress() error
func (*RedisStore) DeleteAgentDispatch ¶ added in v1.7.1
func (s *RedisStore) DeleteAgentDispatch(_ context.Context, dispatch *livekit.AgentDispatch) error
This will not delete the jobs created by the dispatch
func (*RedisStore) DeleteAgentJob ¶ added in v1.7.1
func (*RedisStore) DeleteIngress ¶ added in v1.2.0
func (s *RedisStore) DeleteIngress(_ context.Context, info *livekit.IngressInfo) error
func (*RedisStore) DeleteParticipant ¶ added in v0.15.5
func (s *RedisStore) DeleteParticipant(_ context.Context, roomName livekit.RoomName, identity livekit.ParticipantIdentity) error
func (*RedisStore) DeleteRoom ¶ added in v0.15.5
func (*RedisStore) DeleteSIPDispatchRule ¶ added in v1.5.2
func (s *RedisStore) DeleteSIPDispatchRule(ctx context.Context, sipDispatchRuleId string) error
func (*RedisStore) DeleteSIPTrunk ¶ added in v1.5.2
func (s *RedisStore) DeleteSIPTrunk(ctx context.Context, id string) error
func (*RedisStore) HasParticipant ¶ added in v1.9.0
func (s *RedisStore) HasParticipant(ctx context.Context, roomName livekit.RoomName, identity livekit.ParticipantIdentity) (bool, error)
func (*RedisStore) ListAgentDispatches ¶ added in v1.7.1
func (s *RedisStore) ListAgentDispatches(_ context.Context, roomName livekit.RoomName) ([]*livekit.AgentDispatch, error)
func (*RedisStore) ListEgress ¶ added in v0.15.5
func (s *RedisStore) ListEgress(_ context.Context, roomName livekit.RoomName, active bool) ([]*livekit.EgressInfo, error)
func (*RedisStore) ListIngress ¶ added in v1.2.0
func (s *RedisStore) ListIngress(_ context.Context, roomName livekit.RoomName) ([]*livekit.IngressInfo, error)
func (*RedisStore) ListParticipants ¶ added in v0.15.5
func (s *RedisStore) ListParticipants(_ context.Context, roomName livekit.RoomName) ([]*livekit.ParticipantInfo, error)
func (*RedisStore) ListSIPDispatchRule ¶ added in v1.5.2
func (s *RedisStore) ListSIPDispatchRule(ctx context.Context, req *livekit.ListSIPDispatchRuleRequest) (*livekit.ListSIPDispatchRuleResponse, error)
func (*RedisStore) ListSIPInboundTrunk ¶ added in v1.6.3
func (s *RedisStore) ListSIPInboundTrunk(ctx context.Context, req *livekit.ListSIPInboundTrunkRequest) (*livekit.ListSIPInboundTrunkResponse, error)
func (*RedisStore) ListSIPOutboundTrunk ¶ added in v1.6.3
func (s *RedisStore) ListSIPOutboundTrunk(ctx context.Context, req *livekit.ListSIPOutboundTrunkRequest) (*livekit.ListSIPOutboundTrunkResponse, error)
func (*RedisStore) ListSIPTrunk ¶ added in v1.5.2
func (s *RedisStore) ListSIPTrunk(ctx context.Context, req *livekit.ListSIPTrunkRequest) (*livekit.ListSIPTrunkResponse, error)
func (*RedisStore) LoadEgress ¶ added in v0.15.5
func (s *RedisStore) LoadEgress(_ context.Context, egressID string) (*livekit.EgressInfo, error)
func (*RedisStore) LoadIngress ¶ added in v1.2.0
func (s *RedisStore) LoadIngress(_ context.Context, ingressId string) (*livekit.IngressInfo, error)
func (*RedisStore) LoadIngressFromStreamKey ¶ added in v1.2.0
func (s *RedisStore) LoadIngressFromStreamKey(_ context.Context, streamKey string) (*livekit.IngressInfo, error)
func (*RedisStore) LoadParticipant ¶ added in v0.15.5
func (s *RedisStore) LoadParticipant(_ context.Context, roomName livekit.RoomName, identity livekit.ParticipantIdentity) (*livekit.ParticipantInfo, error)
func (*RedisStore) LoadSIPDispatchRule ¶ added in v1.5.2
func (s *RedisStore) LoadSIPDispatchRule(ctx context.Context, sipDispatchRuleId string) (*livekit.SIPDispatchRuleInfo, error)
func (*RedisStore) LoadSIPInboundTrunk ¶ added in v1.6.3
func (s *RedisStore) LoadSIPInboundTrunk(ctx context.Context, id string) (*livekit.SIPInboundTrunkInfo, error)
func (*RedisStore) LoadSIPOutboundTrunk ¶ added in v1.6.3
func (s *RedisStore) LoadSIPOutboundTrunk(ctx context.Context, id string) (*livekit.SIPOutboundTrunkInfo, error)
func (*RedisStore) LoadSIPTrunk ¶ added in v1.5.2
func (s *RedisStore) LoadSIPTrunk(ctx context.Context, id string) (*livekit.SIPTrunkInfo, error)
func (*RedisStore) RoomExists ¶ added in v1.9.10
func (*RedisStore) Start ¶ added in v1.2.0
func (s *RedisStore) Start() error
func (*RedisStore) Stop ¶ added in v1.2.0
func (s *RedisStore) Stop()
func (*RedisStore) StoreAgentDispatch ¶ added in v1.7.1
func (s *RedisStore) StoreAgentDispatch(_ context.Context, dispatch *livekit.AgentDispatch) error
func (*RedisStore) StoreAgentJob ¶ added in v1.7.1
func (*RedisStore) StoreEgress ¶ added in v0.15.5
func (s *RedisStore) StoreEgress(_ context.Context, info *livekit.EgressInfo) error
func (*RedisStore) StoreIngress ¶ added in v1.2.0
func (s *RedisStore) StoreIngress(ctx context.Context, info *livekit.IngressInfo) error
func (*RedisStore) StoreParticipant ¶ added in v0.15.5
func (s *RedisStore) StoreParticipant(_ context.Context, roomName livekit.RoomName, participant *livekit.ParticipantInfo) error
func (*RedisStore) StoreRoom ¶ added in v0.15.5
func (s *RedisStore) StoreRoom(_ context.Context, room *livekit.Room, internal *livekit.RoomInternal) error
func (*RedisStore) StoreSIPDispatchRule ¶ added in v1.5.2
func (s *RedisStore) StoreSIPDispatchRule(ctx context.Context, info *livekit.SIPDispatchRuleInfo) error
func (*RedisStore) StoreSIPInboundTrunk ¶ added in v1.6.3
func (s *RedisStore) StoreSIPInboundTrunk(ctx context.Context, info *livekit.SIPInboundTrunkInfo) error
func (*RedisStore) StoreSIPOutboundTrunk ¶ added in v1.6.3
func (s *RedisStore) StoreSIPOutboundTrunk(ctx context.Context, info *livekit.SIPOutboundTrunkInfo) error
func (*RedisStore) StoreSIPTrunk ¶ added in v1.5.2
func (s *RedisStore) StoreSIPTrunk(ctx context.Context, info *livekit.SIPTrunkInfo) error
func (*RedisStore) UnlockRoom ¶ added in v0.15.5
func (*RedisStore) UpdateEgress ¶ added in v0.15.5
func (s *RedisStore) UpdateEgress(_ context.Context, info *livekit.EgressInfo) error
func (*RedisStore) UpdateIngress ¶ added in v1.2.0
func (s *RedisStore) UpdateIngress(ctx context.Context, info *livekit.IngressInfo) error
func (*RedisStore) UpdateIngressState ¶ added in v1.2.4
func (s *RedisStore) UpdateIngressState(ctx context.Context, ingressId string, state *livekit.IngressState) error
type RequestBodyLimiter ¶ added in v1.13.6
type RequestBodyLimiter struct {
// contains filtered or unexported fields
}
RequestBodyLimiter bounds the size of an incoming HTTP request body so that large messages cannot exhaust memory. The Twirp handlers decode the whole body before any grant check runs, so the limit is applied here, up front.
It does not decode the body itself: a request whose Content-Length exceeds the limit is rejected with 413, and the body is wrapped with http.MaxBytesReader so a missing or dishonest Content-Length is still caught by the downstream decoder.
func NewRequestBodyLimiter ¶ added in v1.13.6
func NewRequestBodyLimiter(maxBytes int64) *RequestBodyLimiter
func (*RequestBodyLimiter) ServeHTTP ¶ added in v1.13.6
func (l *RequestBodyLimiter) ServeHTTP(w http.ResponseWriter, r *http.Request, next http.HandlerFunc)
type RoomAllocator ¶ added in v0.13.0
type RoomAllocator interface {
AutoCreateEnabled(ctx context.Context) bool
SelectRoomNode(ctx context.Context, roomName livekit.RoomName, nodeID livekit.NodeID) error
CreateRoom(ctx context.Context, req *livekit.CreateRoomRequest, isExplicit bool) (*livekit.Room, *livekit.RoomInternal, bool, error)
ValidateCreateRoom(ctx context.Context, roomName livekit.RoomName) error
}
func NewRoomAllocator ¶ added in v0.13.0
func NewRoomAllocator(conf *config.Config, router routing.Router, rs ObjectStore) (RoomAllocator, error)
type RoomManager ¶
type RoomManager struct {
rpc.UnimplementedParticipantServer
rpc.UnimplementedRoomServer
rpc.UnimplementedRoomManagerServer
// contains filtered or unexported fields
}
RoomManager manages rooms and its interaction with participants. It's responsible for creating, deleting rooms, as well as running sessions for participants
func NewLocalRoomManager ¶ added in v0.12.4
func NewLocalRoomManager( conf *config.Config, roomStore ObjectStore, currentNode routing.LocalNode, router routing.Router, roomAllocator RoomAllocator, telemetry telemetry.TelemetryService, agentClient agent.Client, agentStore AgentStore, egressLauncher rtc.EgressLauncher, versionGenerator utils.TimedVersionGenerator, turnAuthHandler *TURNAuthHandler, bus psrpc.MessageBus, forwardStats *sfu.ForwardStats, ) (*RoomManager, error)
func (*RoomManager) CloseIdleRooms ¶
func (r *RoomManager) CloseIdleRooms()
func (*RoomManager) CreateDispatch ¶ added in v1.7.1
func (r *RoomManager) CreateDispatch(ctx context.Context, req *livekit.AgentDispatch) (*livekit.AgentDispatch, error)
func (*RoomManager) CreateRoom ¶
func (r *RoomManager) CreateRoom(ctx context.Context, req *livekit.CreateRoomRequest) (*livekit.Room, error)
func (*RoomManager) DeleteDispatch ¶ added in v1.7.1
func (r *RoomManager) DeleteDispatch(ctx context.Context, req *livekit.DeleteAgentDispatchRequest) (*livekit.AgentDispatch, error)
func (*RoomManager) DeleteRoom ¶
func (r *RoomManager) DeleteRoom(ctx context.Context, req *livekit.DeleteRoomRequest) (*livekit.DeleteRoomResponse, error)
func (*RoomManager) ForwardParticipant ¶ added in v1.9.0
func (r *RoomManager) ForwardParticipant(ctx context.Context, req *livekit.ForwardParticipantRequest) (*livekit.ForwardParticipantResponse, error)
func (*RoomManager) GetParticipant ¶ added in v1.10.1
func (r *RoomManager) GetParticipant(ctx context.Context, req *livekit.RoomParticipantIdentity) (*livekit.ParticipantInfo, error)
func (*RoomManager) HasParticipants ¶ added in v0.13.0
func (r *RoomManager) HasParticipants() bool
func (*RoomManager) ListDispatch ¶ added in v1.7.1
func (r *RoomManager) ListDispatch(ctx context.Context, req *livekit.ListAgentDispatchRequest) (*livekit.ListAgentDispatchResponse, error)
func (*RoomManager) ListParticipants ¶ added in v1.10.1
func (r *RoomManager) ListParticipants(ctx context.Context, req *livekit.ListParticipantsRequest) (*livekit.ListParticipantsResponse, error)
func (*RoomManager) MoveParticipant ¶ added in v1.9.0
func (r *RoomManager) MoveParticipant(ctx context.Context, req *livekit.MoveParticipantRequest) (*livekit.MoveParticipantResponse, error)
func (*RoomManager) MutePublishedTrack ¶ added in v1.5.1
func (r *RoomManager) MutePublishedTrack(ctx context.Context, req *livekit.MuteRoomTrackRequest) (*livekit.MuteRoomTrackResponse, error)
func (*RoomManager) PerformRpc ¶ added in v1.9.2
func (r *RoomManager) PerformRpc(ctx context.Context, req *livekit.PerformRpcRequest) (*livekit.PerformRpcResponse, error)
func (*RoomManager) RemoveParticipant ¶ added in v1.5.1
func (r *RoomManager) RemoveParticipant(ctx context.Context, req *livekit.RoomParticipantIdentity) (*livekit.RemoveParticipantResponse, error)
func (*RoomManager) SendData ¶ added in v1.5.1
func (r *RoomManager) SendData(ctx context.Context, req *livekit.SendDataRequest) (*livekit.SendDataResponse, error)
func (*RoomManager) StartSession ¶
func (r *RoomManager) StartSession( ctx context.Context, pi routing.ParticipantInit, requestSource routing.MessageSource, responseSink routing.MessageSink, useOneShotSignallingMode bool, ) error
StartSession starts WebRTC session when a new participant is connected, takes place on RTC node
func (*RoomManager) Stop ¶
func (r *RoomManager) Stop()
func (*RoomManager) UpdateParticipant ¶ added in v1.5.1
func (r *RoomManager) UpdateParticipant(ctx context.Context, req *livekit.UpdateParticipantRequest) (*livekit.ParticipantInfo, error)
func (*RoomManager) UpdateRoomMetadata ¶ added in v1.5.1
func (r *RoomManager) UpdateRoomMetadata(ctx context.Context, req *livekit.UpdateRoomMetadataRequest) (*livekit.Room, error)
func (*RoomManager) UpdateSubscriptions ¶ added in v1.5.1
func (r *RoomManager) UpdateSubscriptions(ctx context.Context, req *livekit.UpdateSubscriptionsRequest) (*livekit.UpdateSubscriptionsResponse, error)
type RoomService ¶
type RoomService struct {
rpc.UnimplementedRoomServer
rpc.UnimplementedParticipantServer
// contains filtered or unexported fields
}
func NewRoomService ¶
func NewRoomService( limitConf config.LimitConfig, apiConf config.APIConfig, router routing.MessageRouter, roomAllocator RoomAllocator, serviceStore ServiceStore, egressLauncher rtc.EgressLauncher, topicFormatter rpc.TopicFormatter, roomClient rpc.TypedRoomClient, participantClient rpc.TypedParticipantClient, ) (svc *RoomService, err error)
func (*RoomService) CreateRoom ¶
func (s *RoomService) CreateRoom(ctx context.Context, req *livekit.CreateRoomRequest) (*livekit.Room, error)
func (*RoomService) DeleteRoom ¶
func (s *RoomService) DeleteRoom(ctx context.Context, req *livekit.DeleteRoomRequest) (*livekit.DeleteRoomResponse, error)
func (*RoomService) ForwardParticipant ¶ added in v1.9.0
func (s *RoomService) ForwardParticipant(ctx context.Context, req *livekit.ForwardParticipantRequest) (*livekit.ForwardParticipantResponse, error)
func (*RoomService) GetParticipant ¶
func (s *RoomService) GetParticipant(ctx context.Context, req *livekit.RoomParticipantIdentity) (participant *livekit.ParticipantInfo, err error)
func (*RoomService) ListParticipants ¶
func (s *RoomService) ListParticipants(ctx context.Context, req *livekit.ListParticipantsRequest) (res *livekit.ListParticipantsResponse, err error)
func (*RoomService) ListRooms ¶
func (s *RoomService) ListRooms(ctx context.Context, req *livekit.ListRoomsRequest) (*livekit.ListRoomsResponse, error)
func (*RoomService) MoveParticipant ¶ added in v1.9.0
func (s *RoomService) MoveParticipant(ctx context.Context, req *livekit.MoveParticipantRequest) (*livekit.MoveParticipantResponse, error)
func (*RoomService) MutePublishedTrack ¶
func (s *RoomService) MutePublishedTrack(ctx context.Context, req *livekit.MuteRoomTrackRequest) (*livekit.MuteRoomTrackResponse, error)
func (*RoomService) PerformRpc ¶ added in v1.9.2
func (s *RoomService) PerformRpc(ctx context.Context, req *livekit.PerformRpcRequest) (*livekit.PerformRpcResponse, error)
func (*RoomService) RemoveParticipant ¶
func (s *RoomService) RemoveParticipant(ctx context.Context, req *livekit.RoomParticipantIdentity) (*livekit.RemoveParticipantResponse, error)
func (*RoomService) SendData ¶ added in v0.12.2
func (s *RoomService) SendData(ctx context.Context, req *livekit.SendDataRequest) (*livekit.SendDataResponse, error)
func (*RoomService) UpdateParticipant ¶
func (s *RoomService) UpdateParticipant(ctx context.Context, req *livekit.UpdateParticipantRequest) (*livekit.ParticipantInfo, error)
func (*RoomService) UpdateRoomMetadata ¶ added in v0.13.1
func (s *RoomService) UpdateRoomMetadata(ctx context.Context, req *livekit.UpdateRoomMetadataRequest) (*livekit.Room, error)
func (*RoomService) UpdateSubscriptions ¶ added in v0.9.14
func (s *RoomService) UpdateSubscriptions(ctx context.Context, req *livekit.UpdateSubscriptionsRequest) (*livekit.UpdateSubscriptionsResponse, error)
type SIPService ¶ added in v1.5.2
type SIPService struct {
// contains filtered or unexported fields
}
func NewSIPService ¶ added in v1.5.2
func NewSIPService( conf *config.SIPConfig, nodeID livekit.NodeID, bus psrpc.MessageBus, psrpcClient rpc.SIPClient, store SIPStore, rs livekit.RoomService, ts telemetry.TelemetryService, ) *SIPService
func (*SIPService) CreateSIPDispatchRule ¶ added in v1.5.2
func (s *SIPService) CreateSIPDispatchRule(ctx context.Context, req *livekit.CreateSIPDispatchRuleRequest) (*livekit.SIPDispatchRuleInfo, error)
func (*SIPService) CreateSIPInboundTrunk ¶ added in v1.6.3
func (s *SIPService) CreateSIPInboundTrunk(ctx context.Context, req *livekit.CreateSIPInboundTrunkRequest) (*livekit.SIPInboundTrunkInfo, error)
func (*SIPService) CreateSIPOutboundTrunk ¶ added in v1.6.3
func (s *SIPService) CreateSIPOutboundTrunk(ctx context.Context, req *livekit.CreateSIPOutboundTrunkRequest) (*livekit.SIPOutboundTrunkInfo, error)
func (*SIPService) CreateSIPParticipant ¶ added in v1.5.2
func (s *SIPService) CreateSIPParticipant(ctx context.Context, req *livekit.CreateSIPParticipantRequest) (*livekit.SIPParticipantInfo, error)
func (*SIPService) CreateSIPParticipantRequest ¶ added in v1.8.0
func (s *SIPService) CreateSIPParticipantRequest(ctx context.Context, req *livekit.CreateSIPParticipantRequest, projectID, host, wsUrl, token string) (*rpc.InternalCreateSIPParticipantRequest, error)
func (*SIPService) CreateSIPTrunk ¶ added in v1.5.2
func (s *SIPService) CreateSIPTrunk(ctx context.Context, req *livekit.CreateSIPTrunkRequest) (*livekit.SIPTrunkInfo, error)
func (*SIPService) DeleteSIPDispatchRule ¶ added in v1.5.2
func (s *SIPService) DeleteSIPDispatchRule(ctx context.Context, req *livekit.DeleteSIPDispatchRuleRequest) (*livekit.SIPDispatchRuleInfo, error)
func (*SIPService) DeleteSIPTrunk ¶ added in v1.5.2
func (s *SIPService) DeleteSIPTrunk(ctx context.Context, req *livekit.DeleteSIPTrunkRequest) (*livekit.SIPTrunkInfo, error)
func (*SIPService) GetSIPInboundTrunk ¶ added in v1.8.0
func (s *SIPService) GetSIPInboundTrunk(ctx context.Context, req *livekit.GetSIPInboundTrunkRequest) (*livekit.GetSIPInboundTrunkResponse, error)
func (*SIPService) GetSIPOutboundTrunk ¶ added in v1.8.0
func (s *SIPService) GetSIPOutboundTrunk(ctx context.Context, req *livekit.GetSIPOutboundTrunkRequest) (*livekit.GetSIPOutboundTrunkResponse, error)
func (*SIPService) ListSIPDispatchRule ¶ added in v1.5.2
func (s *SIPService) ListSIPDispatchRule(ctx context.Context, req *livekit.ListSIPDispatchRuleRequest) (*livekit.ListSIPDispatchRuleResponse, error)
func (*SIPService) ListSIPInboundTrunk ¶ added in v1.6.3
func (s *SIPService) ListSIPInboundTrunk(ctx context.Context, req *livekit.ListSIPInboundTrunkRequest) (*livekit.ListSIPInboundTrunkResponse, error)
func (*SIPService) ListSIPOutboundTrunk ¶ added in v1.6.3
func (s *SIPService) ListSIPOutboundTrunk(ctx context.Context, req *livekit.ListSIPOutboundTrunkRequest) (*livekit.ListSIPOutboundTrunkResponse, error)
func (*SIPService) ListSIPTrunk ¶ added in v1.5.2
func (s *SIPService) ListSIPTrunk(ctx context.Context, req *livekit.ListSIPTrunkRequest) (*livekit.ListSIPTrunkResponse, error)
deprecated: ListSIPTrunk will be removed in the future
func (*SIPService) TransferSIPParticipant ¶ added in v1.8.0
func (s *SIPService) TransferSIPParticipant(ctx context.Context, req *livekit.TransferSIPParticipantRequest) (*livekit.TransferSIPParticipantResponse, error)
func (*SIPService) UpdateSIPDispatchRule ¶ added in v1.9.0
func (s *SIPService) UpdateSIPDispatchRule(ctx context.Context, req *livekit.UpdateSIPDispatchRuleRequest) (*livekit.SIPDispatchRuleInfo, error)
func (*SIPService) UpdateSIPInboundTrunk ¶ added in v1.9.0
func (s *SIPService) UpdateSIPInboundTrunk(ctx context.Context, req *livekit.UpdateSIPInboundTrunkRequest) (*livekit.SIPInboundTrunkInfo, error)
func (*SIPService) UpdateSIPOutboundTrunk ¶ added in v1.9.0
func (s *SIPService) UpdateSIPOutboundTrunk(ctx context.Context, req *livekit.UpdateSIPOutboundTrunkRequest) (*livekit.SIPOutboundTrunkInfo, error)
type SIPStore ¶ added in v1.5.2
type SIPStore interface {
StoreSIPTrunk(ctx context.Context, info *livekit.SIPTrunkInfo) error
StoreSIPInboundTrunk(ctx context.Context, info *livekit.SIPInboundTrunkInfo) error
StoreSIPOutboundTrunk(ctx context.Context, info *livekit.SIPOutboundTrunkInfo) error
LoadSIPTrunk(ctx context.Context, sipTrunkID string) (*livekit.SIPTrunkInfo, error)
LoadSIPInboundTrunk(ctx context.Context, sipTrunkID string) (*livekit.SIPInboundTrunkInfo, error)
LoadSIPOutboundTrunk(ctx context.Context, sipTrunkID string) (*livekit.SIPOutboundTrunkInfo, error)
ListSIPTrunk(ctx context.Context, opts *livekit.ListSIPTrunkRequest) (*livekit.ListSIPTrunkResponse, error)
ListSIPInboundTrunk(ctx context.Context, opts *livekit.ListSIPInboundTrunkRequest) (*livekit.ListSIPInboundTrunkResponse, error)
ListSIPOutboundTrunk(ctx context.Context, opts *livekit.ListSIPOutboundTrunkRequest) (*livekit.ListSIPOutboundTrunkResponse, error)
DeleteSIPTrunk(ctx context.Context, sipTrunkID string) error
StoreSIPDispatchRule(ctx context.Context, info *livekit.SIPDispatchRuleInfo) error
LoadSIPDispatchRule(ctx context.Context, sipDispatchRuleID string) (*livekit.SIPDispatchRuleInfo, error)
ListSIPDispatchRule(ctx context.Context, opts *livekit.ListSIPDispatchRuleRequest) (*livekit.ListSIPDispatchRuleResponse, error)
DeleteSIPDispatchRule(ctx context.Context, sipDispatchRuleID string) error
}
type ServiceStore ¶ added in v0.15.5
type ServiceStore interface {
LoadRoom(ctx context.Context, roomName livekit.RoomName, includeInternal bool) (*livekit.Room, *livekit.RoomInternal, error)
RoomExists(ctx context.Context, roomName livekit.RoomName) (bool, error)
// ListRooms returns currently active rooms. if names is not nil, it'll filter and return
// only rooms that match
ListRooms(ctx context.Context, roomNames []livekit.RoomName) ([]*livekit.Room, error)
}
type SessionHandler ¶ added in v1.4.0
type SessionHandler interface {
Logger(ctx context.Context) logger.Logger
HandleSession(
ctx context.Context,
pi routing.ParticipantInit,
connectionID livekit.ConnectionID,
requestSource routing.MessageSource,
responseSink routing.MessageSink,
) error
}
type SignalServer ¶ added in v1.4.0
type SignalServer struct {
// contains filtered or unexported fields
}
func NewDefaultSignalServer ¶ added in v1.4.0
func NewDefaultSignalServer( currentNode routing.LocalNode, bus psrpc.MessageBus, config config.SignalRelayConfig, router routing.Router, roomManager *RoomManager, ) (r *SignalServer, err error)
func NewSignalServer ¶ added in v1.4.0
func NewSignalServer( nodeID livekit.NodeID, region string, bus psrpc.MessageBus, config config.SignalRelayConfig, sessionHandler SessionHandler, ) (*SignalServer, error)
func (*SignalServer) Start ¶ added in v1.4.5
func (s *SignalServer) Start() error
func (*SignalServer) Stop ¶ added in v1.4.0
func (s *SignalServer) Stop()
type StandardRoomAllocator ¶ added in v0.13.7
type StandardRoomAllocator struct {
// contains filtered or unexported fields
}
func (*StandardRoomAllocator) AutoCreateEnabled ¶ added in v1.8.1
func (r *StandardRoomAllocator) AutoCreateEnabled(context.Context) bool
func (*StandardRoomAllocator) CreateRoom ¶ added in v0.13.7
func (r *StandardRoomAllocator) CreateRoom(ctx context.Context, req *livekit.CreateRoomRequest, isExplicit bool) (*livekit.Room, *livekit.RoomInternal, bool, error)
CreateRoom creates a new room from a request and allocates it to a node to handle it'll also monitor its state, and cleans it up when appropriate
func (*StandardRoomAllocator) SelectRoomNode ¶ added in v1.8.0
func (*StandardRoomAllocator) ValidateCreateRoom ¶ added in v1.3.4
type TURNAuthHandler ¶ added in v1.5.0
type TURNAuthHandler struct {
// contains filtered or unexported fields
}
func NewTURNAuthHandler ¶ added in v1.5.0
func NewTURNAuthHandler(keyProvider auth.KeyProvider) *TURNAuthHandler
func (*TURNAuthHandler) CreatePassword ¶ added in v1.5.0
func (h *TURNAuthHandler) CreatePassword(apiKey string, pID livekit.ParticipantID, expiry int64) (string, error)
func (*TURNAuthHandler) CreateUsername ¶ added in v1.5.0
func (h *TURNAuthHandler) CreateUsername(apiKey string, pID livekit.ParticipantID, ttlSeconds int) (string, int64)
func (*TURNAuthHandler) HandleAuth ¶ added in v1.5.0
func (h *TURNAuthHandler) HandleAuth(ra *turn.RequestAttributes) (userID string, key []byte, ok bool)
func (*TURNAuthHandler) ParseUsername ¶ added in v1.9.0
func (h *TURNAuthHandler) ParseUsername(username string) (string, livekit.ParticipantID, int64, error)
type ValidateConnectRequestParams ¶ added in v1.9.1
type ValidateConnectRequestParams struct {
// contains filtered or unexported fields
}
type ValidateConnectRequestResult ¶ added in v1.9.1
type ValidateConnectRequestResult struct {
// contains filtered or unexported fields
}
func ValidateConnectRequest ¶ added in v1.9.1
func ValidateConnectRequest( lgr logger.Logger, r *http.Request, limitConfig config.LimitConfig, params ValidateConnectRequestParams, router routing.MessageRouter, roomAllocator RoomAllocator, ) (ValidateConnectRequestResult, int, error)
type WHIPService ¶ added in v1.9.1
func NewWHIPService ¶ added in v1.9.1
func NewWHIPService( config *config.Config, router routing.Router, roomAllocator RoomAllocator, clientParams rpc.ClientParams, topicFormatter rpc.TopicFormatter, participantClient rpc.TypedWHIPParticipantClient, ) (*WHIPService, error)
func (*WHIPService) SetupRoutes ¶ added in v1.9.1
func (s *WHIPService) SetupRoutes(mux *http.ServeMux)
type WSSignalConnection ¶
type WSSignalConnection struct {
// contains filtered or unexported fields
}
func NewWSSignalConnection ¶
func NewWSSignalConnection(conn types.WebsocketClient, messageSizeLimit int64) *WSSignalConnection
func (*WSSignalConnection) Close ¶ added in v1.7.1
func (c *WSSignalConnection) Close() error
func (*WSSignalConnection) CloseWithReason ¶ added in v1.12.0
func (c *WSSignalConnection) CloseWithReason(reason string) error
func (*WSSignalConnection) ReadRequest ¶
func (c *WSSignalConnection) ReadRequest() (*livekit.SignalRequest, int, error)
func (*WSSignalConnection) ReadWorkerMessage ¶ added in v1.5.1
func (c *WSSignalConnection) ReadWorkerMessage() (*livekit.WorkerMessage, int, error)
func (*WSSignalConnection) SetReadDeadline ¶ added in v1.8.0
func (c *WSSignalConnection) SetReadDeadline(deadline time.Time) error
func (*WSSignalConnection) WriteResponse ¶
func (c *WSSignalConnection) WriteResponse(msg *livekit.SignalResponse) (int, error)
func (*WSSignalConnection) WriteServerMessage ¶ added in v1.5.1
func (c *WSSignalConnection) WriteServerMessage(msg *livekit.ServerMessage) (int, error)
Source Files
¶
- agent_dispatch_service.go
- agentservice.go
- auth.go
- basic_auth.go
- clients.go
- egress.go
- egressid.go
- errors.go
- ingress.go
- interfaces.go
- ioservice.go
- ioservice_ingress.go
- ioservice_sip.go
- localstore.go
- redisstore.go
- redisstore_sip.go
- requestid.go
- roomallocator.go
- roommanager.go
- roommanager_service.go
- roomservice.go
- rtcservice.go
- server.go
- signal.go
- sip.go
- turn.go
- turnquota.go
- twirp.go
- utils.go
- whipservice.go
- wire_gen.go
- wsprotocol.go