Documentation
¶
Index ¶
- Constants
- func AgentIdentityForJobID(jobID string) string
- func AgentWebSocketURL(rawURL string, workerToken string) (string, error)
- func AllRecordingOptions() agent.RecordingOptions
- func AnswerAvailabilityRequest(opts AvailabilityAnswerOptions)
- func AnswerServerAvailabilityRequest(opts AvailabilityAnswerOptions)
- func ApplyServerConnectionEnv(opts ServerConnectionEnvOptions)
- func ApplyWorkerEnv(opts WorkerEnvOptions)
- func AutoSubscribeSDKEnabled(mode string) bool
- func AvailabilityResponseForAccept(req *AvailabilityRequest, args AvailabilityAcceptOptions, agentName string) *lkprotocol.WorkerMessage
- func AvailabilityResponseForReject(req *AvailabilityRequest, args AvailabilityRejectOptions) *lkprotocol.WorkerMessage
- func AvailableWorkerStatusMessage(load float64, jobCount uint32, canAcceptJob bool) *lkprotocol.WorkerMessage
- func AvatarStartInfo(opts AvatarStartInfoOptions) agent.AvatarStartInfo
- func ConnectFailureError(agentURL string, attempts int, err error) error
- func ConnectInfo(opts ConnectInfoOptions) lksdk.ConnectInfo
- func ConnectOptionsForAutoSubscribe(mode string) []lksdk.ConnectOption
- func ConnectRoom(_ context.Context, opts RoomConnectOptions) (*lksdk.Room, error)
- func ConnectWorkerWebSocket(ctx context.Context, opts WorkerWebSocketConnectOptions) (*websocket.Conn, *http.Response, error)
- func CreateSIPParticipant(ctx context.Context, api SIPAPI, job *lkprotocol.Job, callTo string, ...) (*lkprotocol.SIPParticipantInfo, error)
- func CreateSIPParticipantRequest(roomName string, callTo string, trunkID string, identity string, name string) *lkprotocol.CreateSIPParticipantRequest
- func CreateSIPParticipantWithNames(ctx context.Context, api SIPAPI, job *lkprotocol.Job, callTo string, ...) (*lkprotocol.SIPParticipantInfo, error)
- func CreateSIPParticipantWithRequest(ctx context.Context, api SIPAPI, req *lkprotocol.CreateSIPParticipantRequest) (*lkprotocol.SIPParticipantInfo, error)
- func DefaultParticipantKinds() []lkprotocol.ParticipantInfo_Kind
- func DefaultParticipantKindsWhenUnset(kinds []lkprotocol.ParticipantInfo_Kind) []lkprotocol.ParticipantInfo_Kind
- func DeleteRoomBestEffort(ctx context.Context, api DeleteRoomAPI, job *lkprotocol.Job, roomName string) (*lkprotocol.DeleteRoomResponse, error)
- func DeleteRoomRequest(job *lkprotocol.Job, roomName string) *lkprotocol.DeleteRoomRequest
- func DrainingWorkerStatusMessage(jobCount uint32) *lkprotocol.WorkerMessage
- func ExchangeInitialRegisterWebSocket(conn WorkerRegisterWebSocket, msg *lkprotocol.WorkerMessage) (*lkprotocol.ServerMessage, error)
- func ExpirePendingAccept(pending map[string]JobAcceptArguments, timers map[string]*time.Timer, ...) bool
- func ExpireServerPendingAccept(pending map[string]JobAcceptArguments, timers map[string]*time.Timer, ...) bool
- func HasSessionEvaluationReport(report *agent.SessionReport) bool
- func HasSessionRecordingOption(options agent.RecordingOptions) bool
- func InitialRegisterMessage(binary bool, data []byte) (*lkprotocol.ServerMessage, error)
- func InitialRegisterResponse(msg *lkprotocol.ServerMessage) (*lkprotocol.RegisterWorkerResponse, error)
- func InitialRegisterWebSocketMessage(msgType int, data []byte) (*lkprotocol.ServerMessage, error)
- func IsConnectFailure(err error) bool
- func JobAcceptIdentity(job *lkprotocol.Job, identity string) string
- func JobAgentName(job *lkprotocol.Job) string
- func JobAvatarStartInfo(job *lkprotocol.Job, url string, token string, agentIdentity string) agent.AvatarStartInfo
- func JobConnectInfo(job *lkprotocol.Job, opts ConnectInfoOptions) lksdk.ConnectInfo
- func JobContextAvatarStartInfo(job *Job, url string, token string, agentIdentity string) agent.AvatarStartInfo
- func JobContextInferenceHeaders(job *Job) map[string]string
- func JobContextJobID(job *Job) string
- func JobContextJoinPreparedRoom(ctx context.Context, opts AcceptedJobRoomConnectOptions) error
- func JobContextLocalParticipantIdentity(token string, fallbackIdentity string) string
- func JobContextLogFields(job *Job) map[string]any
- func JobContextMoveParticipant(ctx context.Context, api MoveParticipantAPI, job *Job, room string, ...) error
- func JobContextParticipantIdentity(job *Job, fallbackIdentity string) string
- func JobContextRoomName(job *Job) string
- func JobContextRoomReadyForRoomIOStart(room *SDKRoom) bool
- func JobContextTransferSIPParticipantByParticipant(ctx context.Context, api SIPAPI, job *Job, participant any, transferTo string, ...) error
- func JobContextWaitForParticipantAttribute(ctx context.Context, room *SDKRoom, identity string, attribute string, ...) error
- func JobCreateSIPParticipantRequest(job *lkprotocol.Job, callTo string, trunkID string, identity string, ...) *lkprotocol.CreateSIPParticipantRequest
- func JobFromIPC(job workeripc.Job) (*lkprotocol.Job, error)
- func JobID(job *lkprotocol.Job) string
- func JobInferenceHeaders(job *lkprotocol.Job) map[string]string
- func JobLogContextFields(job *lkprotocol.Job) map[string]any
- func JobParticipantIdentity(job *lkprotocol.Job, acceptedIdentity string) string
- func JobPublisher(job *lkprotocol.Job) *lkprotocol.ParticipantInfo
- func JobRoom(job *lkprotocol.Job) *lkprotocol.Room
- func JobRoomName(job *lkprotocol.Job) string
- func JobRunningMessage(jobID string) *lkprotocol.WorkerMessage
- func JobStatusForEntrypointResult(err error, recovered any) lkprotocol.JobStatus
- func JobStatusMessage(jobID string, status lkprotocol.JobStatus) *lkprotocol.WorkerMessage
- func JobStatusSucceeded(status lkprotocol.JobStatus) bool
- func JobTransferSIPParticipantRequest(job *lkprotocol.Job, identity string, transferTo string, playDialtone bool) *lkprotocol.TransferSIPParticipantRequest
- func JobTypeForWorkerType(workerType string) lkprotocol.JobType
- func JobTypeNameForWorkerType(workerType string) string
- func JoinPreparedRoom(ctx context.Context, opts PreparedRoomConnectOptions) error
- func LocalAgentToken(apiKey string, apiSecret string, identity string, room string, ...) (string, error)
- func LocalJobIdentity(token string, explicitIdentity string, newIdentity func(string) string) string
- func LocalJobParticipantIdentityForRun(token string, participantIdentity string) (string, error)
- func LocalJobSessionReportPath(opts LocalJobOptions, sessionDirectory string) string
- func LocalJobToken(existingToken string, apiKey string, apiSecret string, identity string, ...) (string, error)
- func LocalJobTokenIdentity(token string) (string, error)
- func LocalParticipantIdentity(token string, fallbackIdentity string) string
- func LocalRoomJob(opts LocalRoomJobOptions) *lkprotocol.Job
- func MarshalWorkerMessage(msg *lkprotocol.WorkerMessage) ([]byte, error)
- func MigratableRunningJobIDs(jobs []RunningJobInfo) []string
- func MigrateJobMessage(jobIDs []string) *lkprotocol.WorkerMessage
- func MigrateRunningJobsMessage(jobs []RunningJobInfo) *lkprotocol.WorkerMessage
- func MoveParticipant(ctx context.Context, api MoveParticipantAPI, job *lkprotocol.Job, room string, ...) error
- func MoveParticipantRequest(job *lkprotocol.Job, room string, identity string, destinationRoom string) *lkprotocol.MoveParticipantRequest
- func NewJobContextSessionReport(job *Job) (*agent.SessionReport, *agent.Tagger)
- func NewJobSessionReport(job *lkprotocol.Job) (*agent.SessionReport, *agent.Tagger)
- func NormalizeAutoSubscribeMode(mode string) string
- func ParticipantInfoFromRemoteParticipant(participant RemoteParticipantView) *lkprotocol.ParticipantInfo
- func ParticipantInfoKindAllowed(kinds []lkprotocol.ParticipantInfo_Kind, ...) bool
- func ParticipantKindAllowed(kinds []lkprotocol.ParticipantInfo_Kind, kind lkprotocol.ParticipantInfo_Kind) bool
- func PopulateJobContextSessionReport(report *agent.SessionReport, job *Job)
- func PopulateSessionReportWithJobMetadata(report *agent.SessionReport, job *lkprotocol.Job)
- func PrepareLocalJobRunOptions(participantIdentity string, opts LocalJobOptions) (string, error)
- func PrepareServerLocalJobRunOptions(participantIdentity string, opts LocalJobOptions) (string, error)
- func ProcessJobEnv(baseEnv []string, processID string, info RunningJobInfo) ([]string, error)
- func RefreshToken(token string, apiSecret string, now time.Time, ttl time.Duration) (string, error)
- func RegisterWorkerMessage(opts WorkerRegistrationOptions) *lkprotocol.WorkerMessage
- func RegisterWorkerRequest(opts RegisterWorkerOptions) *lkprotocol.WorkerMessage
- func RetryDelay(retryCount int) time.Duration
- func RoomCallbackWithHandlers(cb *lksdk.RoomCallback, handlers RoomCallbackHandlers) *lksdk.RoomCallback
- func RoomDeleteNotFound(err error) bool
- func RoomLocalParticipant(room *lksdk.Room) *lksdk.LocalParticipant
- func RunRunningJobEntrypointLifecycle(opts RunningJobEntrypointLifecycleOptions) error
- func RunServerMessageLoop(ctx context.Context, opts ServerMessageLoopOptions) error
- func RunServerRunningJobEntrypointLifecycle(opts RunningJobEntrypointLifecycleOptions) error
- func RunWorkerMessageLoop(ctx context.Context, opts WorkerMessageLoopOptions) error
- func ServerLocalJobSessionReportPath(opts LocalJobOptions, sessionDirectory string) string
- func ServerLogLevelFromEnv(lookupEnv func(string) string) string
- func ServerMessageFrame(binary bool, data []byte) (*lkprotocol.ServerMessage, error)
- func ServerMessageWebSocketFrame(msgType int, data []byte) (*lkprotocol.ServerMessage, error)
- func ServerMigratableRunningJobIDs(jobs []RunningJobInfo) []string
- func ServerRecordingOptions() agent.RecordingOptions
- func ShouldAutoSubscribeTrack(mode string, kind lksdk.TrackKind) bool
- func ShouldSkipExternalAPIForFakeJob(fakeJob bool) bool
- func ShouldUploadJobSessionReport(job *lkprotocol.Job, fakeJob bool, report *agent.SessionReport) bool
- func StopPendingAssignmentTimer[T PendingAssignmentTimer](pending map[string]T, jobID string)
- func StorePendingAccept(opts PendingAcceptStoreOptions)
- func StoreServerPendingAccept(opts PendingAcceptStoreOptions)
- func ToIPCJobAcceptArguments(args JobAcceptArguments) workeripc.JobAcceptArguments
- func ToIPCRunningJobInfo(info RunningJobInfo) workeripc.RunningJobInfo
- func TokenClaims(token string) (*auth.ClaimGrants, error)
- func TokenIdentity(token string) (string, error)
- func TransferSIPParticipant(ctx context.Context, api SIPAPI, job *lkprotocol.Job, identity string, ...) error
- func TransferSIPParticipantByParticipant(ctx context.Context, api SIPAPI, job *lkprotocol.Job, participant any, ...) error
- func TransferSIPParticipantIdentity(participant any) (string, error)
- func TransferSIPParticipantRequest(roomName string, identity string, transferTo string, playDialtone bool) *lkprotocol.TransferSIPParticipantRequest
- func UnmarshalServerMessage(data []byte) (*lkprotocol.ServerMessage, error)
- func UpsertParticipantInfo(participants []*lkprotocol.ParticipantInfo, info *lkprotocol.ParticipantInfo) []*lkprotocol.ParticipantInfo
- func ValidateLocalJobRunOptions(participantIdentity string, opts LocalJobOptions) error
- func ValidateServerConnectionOptions(opts ServerConnectionOptions) error
- func ValidateWorkerConnectionOptions(opts WorkerConnectionOptions) error
- func WaitForAgent(ctx context.Context, room *lksdk.Room, agentName ...string) (*lksdk.RemoteParticipant, error)
- func WaitForParticipant(ctx context.Context, room *lksdk.Room, identity string, ...) (*lksdk.RemoteParticipant, error)
- func WaitForParticipantAttribute(ctx context.Context, room *lksdk.Room, identity string, attribute string, ...) error
- func WaitForTrackPublication(ctx context.Context, room *lksdk.Room, identity string, ...) (*lksdk.RemoteTrackPublication, error)
- func WaitForTrackPublicationWithOptions(ctx context.Context, room *lksdk.Room, options TrackPublicationWaitOptions) (*lksdk.RemoteTrackPublication, error)
- func WorkerAuthHeader(token string) http.Header
- func WorkerAuthToken(apiKey string, apiSecret string, ttl time.Duration) (string, error)
- func WorkerConnectionFailureMessage() string
- func WorkerLogLevelFromEnv(getenv func(string) string) string
- func WorkerMessageFrame(msg *lkprotocol.WorkerMessage) (bool, []byte, error)
- func WorkerMessageWebSocketFrame(msg *lkprotocol.WorkerMessage) (int, []byte, error)
- func WorkerStatusMessage(status lkprotocol.WorkerStatus, load float64, jobCount uint32) *lkprotocol.WorkerMessage
- func WorkerStatusUpdateMessage(opts WorkerStatusUpdateOptions) *lkprotocol.WorkerMessage
- func WorkerWebSocketDialer(httpProxy string) (*websocket.Dialer, error)
- func WriteServerWorkerMessageWebSocket(writer WorkerMessageWebSocketWriter, msg *WorkerMessage) error
- func WriteWorkerMessageWebSocket(writer WorkerMessageWebSocketWriter, msg *lkprotocol.WorkerMessage) error
- func WriteWorkerRuntimeMetadataHTTPResponse(w http.ResponseWriter, opts WorkerRuntimeMetadataOptions) error
- type AcceptedJobRoomConnectOptions
- type AgentNameEnvOptions
- type AgentNameEnvResult
- type AssignmentContextValueOptions
- type AssignmentContextValuesResult
- type AssignmentInfo
- type AudioDecoder
- type AudioEncoder
- type AutoSubscribe
- type AvailabilityAcceptOptions
- type AvailabilityAnswerOptions
- type AvailabilityRejectOptions
- type AvailabilityRequest
- type AvailabilityRequestInfo
- type AvailabilityResponder
- func (r *AvailabilityResponder) Accept(args JobAcceptArguments) error
- func (r *AvailabilityResponder) Answered() bool
- func (r *AvailabilityResponder) JobRequest() *JobRequest
- func (r *AvailabilityResponder) Reject(args JobRejectArguments) error
- func (r *AvailabilityResponder) RejectIfUnanswered(args JobRejectArguments) error
- type AvailabilityResponderOptions
- type AvatarStartInfoOptions
- type ClaimGrants
- type ConnectInfoOptions
- type ConnectOptions
- type DeleteRoomAPI
- type DeleteRoomPlanResult
- type DeleteRoomResponse
- type EntrypointResult
- func RunEntrypoint(entrypoint func() error) (result EntrypointResult)
- func RunJobEntrypointLifecycle(opts JobEntrypointLifecycleOptions) EntrypointResult
- func RunReloadedJobEntrypointLifecycle(opts ReloadedJobEntrypointLifecycleOptions) EntrypointResult
- func RunServerJobEntrypointLifecycle(opts JobEntrypointLifecycleOptions) EntrypointResult
- func RunServerReloadedJobEntrypointLifecycle(opts ReloadedJobEntrypointLifecycleOptions) EntrypointResult
- type Job
- type JobAPI
- type JobAcceptArguments
- func AcceptPendingAssignment[T PendingAssignmentTimer](pending map[string]JobAcceptArguments, timers map[string]T, jobID string) (JobAcceptArguments, bool)
- func AcceptServerPendingAssignment[T PendingAssignmentTimer](pending map[string]JobAcceptArguments, timers map[string]T, jobID string) (JobAcceptArguments, bool)
- func CloneJobAcceptArguments(args JobAcceptArguments) JobAcceptArguments
- func FromIPCJobAcceptArguments(args workeripc.JobAcceptArguments) JobAcceptArguments
- func JobAcceptArgumentsForJob(job *lkprotocol.Job, args JobAcceptArguments) JobAcceptArguments
- func PopPendingAccept(pending map[string]JobAcceptArguments, jobID string) (JobAcceptArguments, bool)
- type JobAssignment
- type JobCompletionPlan
- type JobEntrypointLifecycleOptions
- type JobFinishPlanResult
- type JobRejectArguments
- type JobRequest
- func (r *JobRequest) Accept(args ...JobAcceptArguments) error
- func (r *JobRequest) AgentName() string
- func (r *JobRequest) ID() string
- func (r *JobRequest) Publisher() *lkprotocol.ParticipantInfo
- func (r *JobRequest) Reject(args ...JobRejectArguments) error
- func (r *JobRequest) Room() *lkprotocol.Room
- type JobRoomServiceAPI
- type JobSIPAPI
- type JobSessionEndPlanOptions
- type JobSessionEndPlanResult
- type JobSessionReportUploadPlanOptions
- type JobSessionReportUploadPlanResult
- type JobStatus
- type JobTermination
- type JobTerminationPlan
- type LocalJobContextSetupPlanOptions
- type LocalJobContextSetupPlanResult
- type LocalJobContextValueOptions
- type LocalJobContextValuesResult
- type LocalJobExecutorPlanResult
- type LocalJobOptions
- type LocalJobRuntimeInfo
- type LocalParticipant
- type LocalRoomJobOptions
- type MetricInfo
- type MoveParticipantAPI
- type MoveParticipantPlanResult
- type ParticipantDetails
- type ParticipantEntrypointRegistrationOptions
- type ParticipantEntrypointRegistrationPlanResult
- type ParticipantEntrypointTaskPlanResult
- type ParticipantInfo
- type ParticipantInfoKind
- type ParticipantTaskKey
- type PendingAcceptStoreOptions
- type PendingAssignmentTimer
- type PlaybackFinishedEvent
- type PlaybackStartedEvent
- type PreConnectAudioBuffer
- type PreConnectAudioHandler
- type PreparedRoomConnectOptions
- type RecorderIO
- func (r *RecorderIO) OutputPath() string
- func (r *RecorderIO) PopulateSessionReport(report *agent.SessionReport)
- func (r *RecorderIO) RecordInput(frame *model.AudioFrame)
- func (r *RecorderIO) RecordOutput(frame *model.AudioFrame)
- func (r *RecorderIO) Recording() bool
- func (r *RecorderIO) RecordingStartedAt() *time.Time
- func (r *RecorderIO) Start(outputPath string, sampleRate int) error
- func (r *RecorderIO) Stop() error
- type RegisterMessageInfo
- type RegisterWorkerOptions
- type ReloadedJobContextValueOptions
- type ReloadedJobEntrypointLifecycleOptions
- type RemoteParticipant
- type RemoteParticipantView
- type RemoteTrackPublication
- func JobContextWaitForTrackPublication(ctx context.Context, room *SDKRoom, identity string, kinds ...TrackType) (*RemoteTrackPublication, error)
- func JobContextWaitForTrackPublicationWithOptions(ctx context.Context, room *SDKRoom, options TrackPublicationWaitOptions) (*RemoteTrackPublication, error)
- type RemoteTrackPublicationView
- type RemoteTrackSubscriptionResult
- func ApplyAutoSubscribeToRoom(room *lksdk.Room, mode string) []RemoteTrackSubscriptionResult
- func JobContextApplyAutoSubscribeToRoom(room *SDKRoom, mode string) []RemoteTrackSubscriptionResult
- func SubscribeRemoteTrackIfAllowed(mode string, publication RemoteTrackPublicationView) RemoteTrackSubscriptionResult
- type Room
- type RoomCallback
- type RoomCallbackHandlers
- type RoomConnectOptions
- type RoomConnectionStateChangedEvent
- type RoomConnector
- type RoomDisconnectedEvent
- type RoomEvent
- type RoomIO
- func (rio *RoomIO) AttachRoom(room *lksdk.Room)
- func (rio *RoomIO) AudioOutputDiagnostics() RoomIOAudioOutputDiagnostics
- func (rio *RoomIO) CanPauseAudioOutput() bool
- func (rio *RoomIO) ClearBuffer()
- func (rio *RoomIO) Close() error
- func (rio *RoomIO) Flush()
- func (rio *RoomIO) GetCallback() *lksdk.RoomCallback
- func (rio *RoomIO) LinkedParticipant() (string, bool)
- func (rio *RoomIO) OffPlaybackFinished(callback func(PlaybackFinishedEvent))
- func (rio *RoomIO) OffPlaybackStarted(callback func(PlaybackStartedEvent))
- func (rio *RoomIO) On(eventType string, callback func(RoomEvent)) func()
- func (rio *RoomIO) OnPlaybackFinished(callback func(PlaybackFinishedEvent))
- func (rio *RoomIO) OnPlaybackStarted(callback func(PlaybackStartedEvent))
- func (rio *RoomIO) PauseAudioOutput()
- func (rio *RoomIO) PublishAudio(ctx context.Context, frame *model.AudioFrame) error
- func (rio *RoomIO) PublishDTMF(code int32, digit string) error
- func (rio *RoomIO) ResumeAudioOutput()
- func (rio *RoomIO) SetParticipant(participantIdentity string)
- func (rio *RoomIO) Start(ctx context.Context) error
- func (rio *RoomIO) UnsetParticipant()
- func (rio *RoomIO) WaitForPlayout(ctx context.Context) (PlaybackFinishedEvent, error)
- func (rio *RoomIO) WithCallback(cb *lksdk.RoomCallback) *lksdk.RoomCallback
- type RoomIOAudioOutputDiagnostics
- type RoomLocalTrackPublishedEvent
- type RoomMovedEvent
- type RoomOptions
- type RoomParticipantActiveEvent
- type RoomParticipantAttributesChangedEvent
- type RoomParticipantConnectedEvent
- type RoomParticipantDisconnectedEvent
- type RoomSipDTMFReceivedEvent
- type RoomTrackPublishedEvent
- type RoomTrackSubscribedEvent
- type RoomTrackUnpublishedEvent
- type RunningJobContextValueOptions
- type RunningJobContextValuesResult
- func ReloadedJobContextValues(opts ReloadedJobContextValueOptions) RunningJobContextValuesResult
- func RunningJobContextValues(opts RunningJobContextValueOptions) RunningJobContextValuesResult
- func ServerReloadedJobContextValues(opts ReloadedJobContextValueOptions) RunningJobContextValuesResult
- func ServerRunningJobContextValues(opts RunningJobContextValueOptions) RunningJobContextValuesResult
- type RunningJobEntrypointLifecycleOptions
- type RunningJobInfo
- func CloneRunningJobInfo(info RunningJobInfo) RunningJobInfo
- func FromIPCRunningJobInfo(info workeripc.RunningJobInfo) (RunningJobInfo, error)
- func FromIPCRunningJobInfos(infos []workeripc.RunningJobInfo) ([]RunningJobInfo, error)
- func RefreshRunningJobTokenForReload(info RunningJobInfo, apiSecret string, now time.Time) (RunningJobInfo, error)
- func RefreshRunningJobsForReload(jobs []RunningJobInfo, apiSecret string, now time.Time) ([]RunningJobInfo, error)
- func RefreshServerRunningJobsForReload(jobs []RunningJobInfo, apiSecret string, now time.Time) ([]RunningJobInfo, error)
- func RunningJobInfoFromEnv(env map[string]string) (RunningJobInfo, error)
- func RunningJobInfoSnapshot(opts RunningJobInfoOptions) RunningJobInfo
- func ServerRunningJobInfoSnapshot(opts RunningJobInfoOptions) RunningJobInfo
- type RunningJobInfoOptions
- type RuntimeJobInfo
- type SDKRoom
- type SIPAPI
- type SIPCreateParticipantPlanResult
- type SIPCreateParticipantRequest
- type SIPParticipantInfo
- type SIPTransferParticipantPlanResult
- type ServerAvailableWorkerStatusMessageOptions
- type ServerConnectionEnvOptions
- type ServerConnectionOptions
- type ServerConnectionResolveOptions
- type ServerInfo
- type ServerMessage
- type ServerMessageDispatchInfo
- type ServerMessageKind
- type ServerMessageLoopOptions
- type ServerMessageRouteOptions
- type ServerRegisterWorkerMessageOptions
- type SessionReportInfo
- type TerminationInfo
- type TextInputCallback
- type TextInputEvent
- type TrackPublicationWaitOptions
- type TrackType
- type TranscriptionTextOutput
- type WorkerConnect
- type WorkerConnectOptions
- type WorkerConnectionOptions
- type WorkerEnvOptions
- type WorkerMessage
- func ServerAvailableWorkerStatusMessage(opts ServerAvailableWorkerStatusMessageOptions) *WorkerMessage
- func ServerDrainingWorkerStatusMessage(jobCount uint32) *WorkerMessage
- func ServerJobRunningMessage(jobID string) *WorkerMessage
- func ServerJobStatusMessage(jobID string, status JobStatus) *WorkerMessage
- func ServerMigrateRunningJobsMessage(jobs []RunningJobInfo) *WorkerMessage
- func ServerRegisterWorkerMessage(opts ServerRegisterWorkerMessageOptions) *WorkerMessage
- type WorkerMessageLoopOptions
- type WorkerMessageWebSocketWriter
- type WorkerMetadataOptions
- type WorkerMetadataResponse
- type WorkerPermissions
- type WorkerRegisterWebSocket
- type WorkerRegisteredEvent
- type WorkerRegisteredHandler
- type WorkerRegistrationOptions
- type WorkerRuntimeMetadataOptions
- type WorkerStatusUpdateOptions
- type WorkerType
- type WorkerWebSocketConnectOptions
- type WorkerWebSocketDialFunc
- type WorkerWebSocketOpenOptions
- type WorkerWebSocketOpenResult
- type WorkerWebSocketReadFunc
- type WorkerWebSocketReader
- type WorkerWebSocketSleepFunc
Constants ¶
View Source
const ( WorkerURLEnvVar = workeripc.WorkerURLEnvVar WorkerAPIKeyEnvVar = workeripc.WorkerAPIKeyEnvVar WorkerAPISecretEnvVar = workeripc.WorkerAPISecretEnvVar ProcessIDEnvVar = workeripc.ProcessIDEnvVar JobJSONEnvVar = workeripc.JobJSONEnvVar RunningJobJSONEnvVar = workeripc.RunningJobJSONEnvVar )
View Source
const ( RoomEventDisconnected = "disconnected" RoomEventConnectionStateChanged = "connection_state_changed" RoomEventRoomMoved = "room_moved" RoomEventParticipantConnected = "participant_connected" RoomEventParticipantDisconnected = "participant_disconnected" RoomEventParticipantAttributesChanged = "participant_attributes_changed" RoomEventParticipantActive = "participant_active" RoomEventTrackSubscribed = "track_subscribed" RoomEventTrackUnpublished = "track_unpublished" RoomEventTrackPublished = "track_published" RoomEventLocalTrackPublished = "local_track_published" RoomEventSipDTMFReceived = "sip_dtmf_received" )
View Source
const DefaultSIPParticipantName = "SIP-participant"
View Source
const ParticipantAttributeAgentName = "lk.agent.name"
View Source
const PreConnectAudioBufferStream = "lk.agent.pre-connect-audio-buffer"
View Source
const RoomIOAgentStateAttribute = "lk.agent.state"
View Source
const RoomIOChatTopic = "lk.chat"
View Source
const RoomIOPublishOnBehalfAttribute = "lk.publish_on_behalf"
View Source
const RoomIOSimulatorAttribute = "lk.simulator"
View Source
const RoomIOTranscriptionFinalAttribute = "lk.transcription_final"
View Source
const RoomIOTranscriptionSegmentIDAttribute = "lk.segment_id"
View Source
const RoomIOTranscriptionTopic = "lk.transcription"
View Source
const RoomIOTranscriptionTrackIDAttribute = "lk.transcribed_track_id"
View Source
const WorkerLogLevelEnvVar = "LIVEKIT_LOG_LEVEL"
Variables ¶
This section is empty.
Functions ¶
func AgentIdentityForJobID ¶
func AllRecordingOptions ¶
func AllRecordingOptions() agent.RecordingOptions
func AnswerAvailabilityRequest ¶
func AnswerAvailabilityRequest(opts AvailabilityAnswerOptions)
func AnswerServerAvailabilityRequest ¶
func AnswerServerAvailabilityRequest(opts AvailabilityAnswerOptions)
func ApplyServerConnectionEnv ¶
func ApplyServerConnectionEnv(opts ServerConnectionEnvOptions)
func ApplyWorkerEnv ¶
func ApplyWorkerEnv(opts WorkerEnvOptions)
func AutoSubscribeSDKEnabled ¶
func AvailabilityResponseForAccept ¶
func AvailabilityResponseForAccept( req *AvailabilityRequest, args AvailabilityAcceptOptions, agentName string, ) *lkprotocol.WorkerMessage
func AvailabilityResponseForReject ¶
func AvailabilityResponseForReject( req *AvailabilityRequest, args AvailabilityRejectOptions, ) *lkprotocol.WorkerMessage
func AvailableWorkerStatusMessage ¶
func AvailableWorkerStatusMessage(load float64, jobCount uint32, canAcceptJob bool) *lkprotocol.WorkerMessage
func AvatarStartInfo ¶
func AvatarStartInfo(opts AvatarStartInfoOptions) agent.AvatarStartInfo
func ConnectInfo ¶
func ConnectInfo(opts ConnectInfoOptions) lksdk.ConnectInfo
func ConnectOptionsForAutoSubscribe ¶
func ConnectOptionsForAutoSubscribe(mode string) []lksdk.ConnectOption
func ConnectRoom ¶
func ConnectWorkerWebSocket ¶
func CreateSIPParticipant ¶
func CreateSIPParticipant( ctx context.Context, api SIPAPI, job *lkprotocol.Job, callTo string, trunkID string, identity string, name string, ) (*lkprotocol.SIPParticipantInfo, error)
func CreateSIPParticipantRequest ¶
func CreateSIPParticipantRequest( roomName string, callTo string, trunkID string, identity string, name string, ) *lkprotocol.CreateSIPParticipantRequest
func CreateSIPParticipantWithNames ¶
func CreateSIPParticipantWithNames( ctx context.Context, api SIPAPI, job *lkprotocol.Job, callTo string, trunkID string, identity string, names ...string, ) (*lkprotocol.SIPParticipantInfo, error)
func CreateSIPParticipantWithRequest ¶
func CreateSIPParticipantWithRequest( ctx context.Context, api SIPAPI, req *lkprotocol.CreateSIPParticipantRequest, ) (*lkprotocol.SIPParticipantInfo, error)
func DefaultParticipantKinds ¶
func DefaultParticipantKinds() []lkprotocol.ParticipantInfo_Kind
func DefaultParticipantKindsWhenUnset ¶
func DefaultParticipantKindsWhenUnset(kinds []lkprotocol.ParticipantInfo_Kind) []lkprotocol.ParticipantInfo_Kind
func DeleteRoomBestEffort ¶
func DeleteRoomBestEffort(ctx context.Context, api DeleteRoomAPI, job *lkprotocol.Job, roomName string) (*lkprotocol.DeleteRoomResponse, error)
func DeleteRoomRequest ¶
func DeleteRoomRequest(job *lkprotocol.Job, roomName string) *lkprotocol.DeleteRoomRequest
func DrainingWorkerStatusMessage ¶
func DrainingWorkerStatusMessage(jobCount uint32) *lkprotocol.WorkerMessage
func ExchangeInitialRegisterWebSocket ¶
func ExchangeInitialRegisterWebSocket(conn WorkerRegisterWebSocket, msg *lkprotocol.WorkerMessage) (*lkprotocol.ServerMessage, error)
func ExpirePendingAccept ¶
func HasSessionEvaluationReport ¶
func HasSessionEvaluationReport(report *agent.SessionReport) bool
func HasSessionRecordingOption ¶
func HasSessionRecordingOption(options agent.RecordingOptions) bool
func InitialRegisterMessage ¶
func InitialRegisterMessage(binary bool, data []byte) (*lkprotocol.ServerMessage, error)
func InitialRegisterResponse ¶
func InitialRegisterResponse(msg *lkprotocol.ServerMessage) (*lkprotocol.RegisterWorkerResponse, error)
func InitialRegisterWebSocketMessage ¶
func InitialRegisterWebSocketMessage(msgType int, data []byte) (*lkprotocol.ServerMessage, error)
func IsConnectFailure ¶
func JobAcceptIdentity ¶
func JobAcceptIdentity(job *lkprotocol.Job, identity string) string
func JobAgentName ¶
func JobAgentName(job *lkprotocol.Job) string
func JobAvatarStartInfo ¶
func JobAvatarStartInfo(job *lkprotocol.Job, url string, token string, agentIdentity string) agent.AvatarStartInfo
func JobConnectInfo ¶
func JobConnectInfo(job *lkprotocol.Job, opts ConnectInfoOptions) lksdk.ConnectInfo
func JobContextJobID ¶
func JobContextJoinPreparedRoom ¶
func JobContextJoinPreparedRoom(ctx context.Context, opts AcceptedJobRoomConnectOptions) error
func JobContextLogFields ¶
func JobContextRoomName ¶
func JobContextRoomReadyForRoomIOStart ¶ added in v0.1.6
func JobCreateSIPParticipantRequest ¶
func JobCreateSIPParticipantRequest( job *lkprotocol.Job, callTo string, trunkID string, identity string, name string, ) *lkprotocol.CreateSIPParticipantRequest
func JobFromIPC ¶
func JobFromIPC(job workeripc.Job) (*lkprotocol.Job, error)
func JobID ¶
func JobID(job *lkprotocol.Job) string
func JobInferenceHeaders ¶
func JobInferenceHeaders(job *lkprotocol.Job) map[string]string
func JobLogContextFields ¶
func JobLogContextFields(job *lkprotocol.Job) map[string]any
func JobParticipantIdentity ¶
func JobParticipantIdentity(job *lkprotocol.Job, acceptedIdentity string) string
func JobPublisher ¶
func JobPublisher(job *lkprotocol.Job) *lkprotocol.ParticipantInfo
func JobRoom ¶
func JobRoom(job *lkprotocol.Job) *lkprotocol.Room
func JobRoomName ¶
func JobRoomName(job *lkprotocol.Job) string
func JobRunningMessage ¶
func JobRunningMessage(jobID string) *lkprotocol.WorkerMessage
func JobStatusForEntrypointResult ¶
func JobStatusForEntrypointResult(err error, recovered any) lkprotocol.JobStatus
func JobStatusMessage ¶
func JobStatusMessage(jobID string, status lkprotocol.JobStatus) *lkprotocol.WorkerMessage
func JobStatusSucceeded ¶
func JobStatusSucceeded(status lkprotocol.JobStatus) bool
func JobTransferSIPParticipantRequest ¶
func JobTransferSIPParticipantRequest( job *lkprotocol.Job, identity string, transferTo string, playDialtone bool, ) *lkprotocol.TransferSIPParticipantRequest
func JobTypeForWorkerType ¶
func JobTypeForWorkerType(workerType string) lkprotocol.JobType
func JoinPreparedRoom ¶
func JoinPreparedRoom(ctx context.Context, opts PreparedRoomConnectOptions) error
func LocalAgentToken ¶
func LocalJobIdentity ¶
func LocalJobSessionReportPath ¶
func LocalJobSessionReportPath(opts LocalJobOptions, sessionDirectory string) string
func LocalJobToken ¶
func LocalJobTokenIdentity ¶
func LocalRoomJob ¶
func LocalRoomJob(opts LocalRoomJobOptions) *lkprotocol.Job
func MarshalWorkerMessage ¶
func MarshalWorkerMessage(msg *lkprotocol.WorkerMessage) ([]byte, error)
func MigratableRunningJobIDs ¶
func MigratableRunningJobIDs(jobs []RunningJobInfo) []string
func MigrateJobMessage ¶
func MigrateJobMessage(jobIDs []string) *lkprotocol.WorkerMessage
func MigrateRunningJobsMessage ¶
func MigrateRunningJobsMessage(jobs []RunningJobInfo) *lkprotocol.WorkerMessage
func MoveParticipant ¶
func MoveParticipant(ctx context.Context, api MoveParticipantAPI, job *lkprotocol.Job, room string, identity string, destinationRoom string) error
func MoveParticipantRequest ¶
func MoveParticipantRequest(job *lkprotocol.Job, room string, identity string, destinationRoom string) *lkprotocol.MoveParticipantRequest
func NewJobContextSessionReport ¶
func NewJobContextSessionReport(job *Job) (*agent.SessionReport, *agent.Tagger)
func NewJobSessionReport ¶
func NewJobSessionReport(job *lkprotocol.Job) (*agent.SessionReport, *agent.Tagger)
func ParticipantInfoFromRemoteParticipant ¶
func ParticipantInfoFromRemoteParticipant(participant RemoteParticipantView) *lkprotocol.ParticipantInfo
func ParticipantInfoKindAllowed ¶
func ParticipantInfoKindAllowed(kinds []lkprotocol.ParticipantInfo_Kind, participant *lkprotocol.ParticipantInfo) bool
func ParticipantKindAllowed ¶
func ParticipantKindAllowed(kinds []lkprotocol.ParticipantInfo_Kind, kind lkprotocol.ParticipantInfo_Kind) bool
func PopulateJobContextSessionReport ¶
func PopulateJobContextSessionReport(report *agent.SessionReport, job *Job)
func PopulateSessionReportWithJobMetadata ¶
func PopulateSessionReportWithJobMetadata(report *agent.SessionReport, job *lkprotocol.Job)
func PrepareLocalJobRunOptions ¶
func PrepareLocalJobRunOptions(participantIdentity string, opts LocalJobOptions) (string, error)
func PrepareServerLocalJobRunOptions ¶
func PrepareServerLocalJobRunOptions(participantIdentity string, opts LocalJobOptions) (string, error)
func ProcessJobEnv ¶
func ProcessJobEnv(baseEnv []string, processID string, info RunningJobInfo) ([]string, error)
func RefreshToken ¶
func RegisterWorkerMessage ¶
func RegisterWorkerMessage(opts WorkerRegistrationOptions) *lkprotocol.WorkerMessage
func RegisterWorkerRequest ¶
func RegisterWorkerRequest(opts RegisterWorkerOptions) *lkprotocol.WorkerMessage
func RetryDelay ¶
func RoomCallbackWithHandlers ¶
func RoomCallbackWithHandlers(cb *lksdk.RoomCallback, handlers RoomCallbackHandlers) *lksdk.RoomCallback
func RoomDeleteNotFound ¶
func RoomLocalParticipant ¶
func RoomLocalParticipant(room *lksdk.Room) *lksdk.LocalParticipant
func RunRunningJobEntrypointLifecycle ¶
func RunRunningJobEntrypointLifecycle(opts RunningJobEntrypointLifecycleOptions) error
func RunServerMessageLoop ¶
func RunServerMessageLoop(ctx context.Context, opts ServerMessageLoopOptions) error
func RunServerRunningJobEntrypointLifecycle ¶
func RunServerRunningJobEntrypointLifecycle(opts RunningJobEntrypointLifecycleOptions) error
func RunWorkerMessageLoop ¶
func RunWorkerMessageLoop(ctx context.Context, opts WorkerMessageLoopOptions) error
func ServerLocalJobSessionReportPath ¶
func ServerLocalJobSessionReportPath(opts LocalJobOptions, sessionDirectory string) string
func ServerLogLevelFromEnv ¶
func ServerMessageFrame ¶
func ServerMessageFrame(binary bool, data []byte) (*lkprotocol.ServerMessage, error)
func ServerMessageWebSocketFrame ¶
func ServerMessageWebSocketFrame(msgType int, data []byte) (*lkprotocol.ServerMessage, error)
func ServerMigratableRunningJobIDs ¶
func ServerMigratableRunningJobIDs(jobs []RunningJobInfo) []string
func ServerRecordingOptions ¶
func ServerRecordingOptions() agent.RecordingOptions
func ShouldUploadJobSessionReport ¶
func ShouldUploadJobSessionReport(job *lkprotocol.Job, fakeJob bool, report *agent.SessionReport) bool
func StopPendingAssignmentTimer ¶
func StopPendingAssignmentTimer[T PendingAssignmentTimer](pending map[string]T, jobID string)
func StorePendingAccept ¶
func StorePendingAccept(opts PendingAcceptStoreOptions)
func StoreServerPendingAccept ¶
func StoreServerPendingAccept(opts PendingAcceptStoreOptions)
func ToIPCJobAcceptArguments ¶
func ToIPCJobAcceptArguments(args JobAcceptArguments) workeripc.JobAcceptArguments
func ToIPCRunningJobInfo ¶
func ToIPCRunningJobInfo(info RunningJobInfo) workeripc.RunningJobInfo
func TokenClaims ¶
func TokenClaims(token string) (*auth.ClaimGrants, error)
func TokenIdentity ¶
func TransferSIPParticipant ¶
func TransferSIPParticipantRequest ¶
func TransferSIPParticipantRequest( roomName string, identity string, transferTo string, playDialtone bool, ) *lkprotocol.TransferSIPParticipantRequest
func UnmarshalServerMessage ¶
func UnmarshalServerMessage(data []byte) (*lkprotocol.ServerMessage, error)
func UpsertParticipantInfo ¶
func UpsertParticipantInfo(participants []*lkprotocol.ParticipantInfo, info *lkprotocol.ParticipantInfo) []*lkprotocol.ParticipantInfo
func ValidateLocalJobRunOptions ¶
func ValidateLocalJobRunOptions(participantIdentity string, opts LocalJobOptions) error
func ValidateServerConnectionOptions ¶
func ValidateServerConnectionOptions(opts ServerConnectionOptions) error
func ValidateWorkerConnectionOptions ¶
func ValidateWorkerConnectionOptions(opts WorkerConnectionOptions) error
func WaitForAgent ¶
func WaitForParticipant ¶
func WaitForParticipant( ctx context.Context, room *lksdk.Room, identity string, kinds ...lkprotocol.ParticipantInfo_Kind, ) (*lksdk.RemoteParticipant, error)
func WaitForTrackPublication ¶
func WaitForTrackPublication( ctx context.Context, room *lksdk.Room, identity string, kinds ...lkprotocol.TrackType, ) (*lksdk.RemoteTrackPublication, error)
func WaitForTrackPublicationWithOptions ¶
func WaitForTrackPublicationWithOptions( ctx context.Context, room *lksdk.Room, options TrackPublicationWaitOptions, ) (*lksdk.RemoteTrackPublication, error)
func WorkerAuthHeader ¶
func WorkerAuthToken ¶
func WorkerConnectionFailureMessage ¶
func WorkerConnectionFailureMessage() string
func WorkerLogLevelFromEnv ¶
func WorkerMessageFrame ¶
func WorkerMessageFrame(msg *lkprotocol.WorkerMessage) (bool, []byte, error)
func WorkerMessageWebSocketFrame ¶
func WorkerMessageWebSocketFrame(msg *lkprotocol.WorkerMessage) (int, []byte, error)
func WorkerStatusMessage ¶
func WorkerStatusMessage(status lkprotocol.WorkerStatus, load float64, jobCount uint32) *lkprotocol.WorkerMessage
func WorkerStatusUpdateMessage ¶
func WorkerStatusUpdateMessage(opts WorkerStatusUpdateOptions) *lkprotocol.WorkerMessage
func WorkerWebSocketDialer ¶
func WriteServerWorkerMessageWebSocket ¶
func WriteServerWorkerMessageWebSocket(writer WorkerMessageWebSocketWriter, msg *WorkerMessage) error
func WriteWorkerMessageWebSocket ¶
func WriteWorkerMessageWebSocket(writer WorkerMessageWebSocketWriter, msg *lkprotocol.WorkerMessage) error
func WriteWorkerRuntimeMetadataHTTPResponse ¶
func WriteWorkerRuntimeMetadataHTTPResponse(w http.ResponseWriter, opts WorkerRuntimeMetadataOptions) error
Types ¶
type AcceptedJobRoomConnectOptions ¶
type AcceptedJobRoomConnectOptions struct {
Room *lksdk.Room
URL string
Token string
Job *lkprotocol.Job
APIKey string
APISecret string
Accept JobAcceptArguments
Identity string
AutoSubscribe string
Connector RoomConnector
}
type AgentNameEnvOptions ¶
type AgentNameEnvResult ¶
func ResolveAgentNameFromEnv ¶
func ResolveAgentNameFromEnv(opts AgentNameEnvOptions) AgentNameEnvResult
func ResolveServerAgentNameFromEnv ¶
func ResolveServerAgentNameFromEnv(opts AgentNameEnvOptions) AgentNameEnvResult
type AssignmentContextValueOptions ¶
type AssignmentContextValueOptions struct {
Assignment AssignmentInfo
AcceptArguments JobAcceptArguments
WorkerID string
}
type AssignmentContextValuesResult ¶
type AssignmentContextValuesResult struct {
Job *lkprotocol.Job
JobID string
URL string
Token string
WorkerID string
AcceptArguments JobAcceptArguments
EnableRecording bool
}
func AssignmentContextValues ¶
func AssignmentContextValues(opts AssignmentContextValueOptions) AssignmentContextValuesResult
func ServerAssignmentContextValues ¶
func ServerAssignmentContextValues(opts AssignmentContextValueOptions) AssignmentContextValuesResult
type AssignmentInfo ¶
type AssignmentInfo struct {
Job *lkprotocol.Job
JobID string
URL string
Token string
EnableRecording bool
}
func JobAssignmentInfo ¶
func JobAssignmentInfo(req *JobAssignment, defaultURL string) AssignmentInfo
type AudioDecoder ¶
type AudioEncoder ¶
type AutoSubscribe ¶
type AutoSubscribe string
const ( AutoSubscribeSubscribeAll AutoSubscribe = "subscribe_all" AutoSubscribeSubscribeNone AutoSubscribe = "subscribe_none" AutoSubscribeAudioOnly AutoSubscribe = "audio_only" AutoSubscribeVideoOnly AutoSubscribe = "video_only" )
type AvailabilityAcceptOptions ¶
type AvailabilityAcceptOptions = JobAcceptArguments
type AvailabilityAnswerOptions ¶
type AvailabilityAnswerOptions struct {
Request *AvailabilityRequest
AgentName string
AvailableForJob func() bool
ReserveSlot func()
ReleaseSlot func()
StoreAccept func(jobID string, args JobAcceptArguments)
Send func(*lkprotocol.WorkerMessage) error
HandleRequest func(*JobRequest) error
OnRequestError func(error, string)
}
type AvailabilityRejectOptions ¶
type AvailabilityRejectOptions = JobRejectArguments
type AvailabilityRequest ¶
type AvailabilityRequest = lkprotocol.AvailabilityRequest
type AvailabilityRequestInfo ¶
type AvailabilityRequestInfo struct {
Job *lkprotocol.Job
JobID string
}
func AvailabilityInfo ¶
func AvailabilityInfo(req *AvailabilityRequest) AvailabilityRequestInfo
type AvailabilityResponder ¶
type AvailabilityResponder struct {
// contains filtered or unexported fields
}
func NewAvailabilityResponder ¶
func NewAvailabilityResponder(opts AvailabilityResponderOptions) *AvailabilityResponder
func (*AvailabilityResponder) Accept ¶
func (r *AvailabilityResponder) Accept(args JobAcceptArguments) error
func (*AvailabilityResponder) Answered ¶
func (r *AvailabilityResponder) Answered() bool
func (*AvailabilityResponder) JobRequest ¶
func (r *AvailabilityResponder) JobRequest() *JobRequest
func (*AvailabilityResponder) Reject ¶
func (r *AvailabilityResponder) Reject(args JobRejectArguments) error
func (*AvailabilityResponder) RejectIfUnanswered ¶
func (r *AvailabilityResponder) RejectIfUnanswered(args JobRejectArguments) error
type AvailabilityResponderOptions ¶
type AvailabilityResponderOptions struct {
Request *AvailabilityRequest
AgentName string
StoreAccept func(jobID string, args JobAcceptArguments)
Send func(*lkprotocol.WorkerMessage) error
}
type AvatarStartInfoOptions ¶
type ClaimGrants ¶
type ClaimGrants = auth.ClaimGrants
func JobContextTokenClaims ¶
func JobContextTokenClaims(token string) (*ClaimGrants, error)
type ConnectInfoOptions ¶
type ConnectOptions ¶
type ConnectOptions struct {
AutoSubscribe AutoSubscribe
}
func JobContextNormalizeConnectOptions ¶
func JobContextNormalizeConnectOptions(options ...ConnectOptions) ConnectOptions
func NormalizeConnectOptions ¶
func NormalizeConnectOptions(options ...ConnectOptions) ConnectOptions
type DeleteRoomAPI ¶
type DeleteRoomAPI interface {
DeleteRoom(context.Context, *lkprotocol.DeleteRoomRequest) (*lkprotocol.DeleteRoomResponse, error)
}
type DeleteRoomPlanResult ¶
type DeleteRoomPlanResult struct {
Skip bool
Response *lkprotocol.DeleteRoomResponse
}
func DeleteRoomPlan ¶
func DeleteRoomPlan(fakeJob bool) DeleteRoomPlanResult
func JobContextDeleteRoomPlan ¶
func JobContextDeleteRoomPlan(fakeJob bool) DeleteRoomPlanResult
type DeleteRoomResponse ¶
type DeleteRoomResponse = lkprotocol.DeleteRoomResponse
func JobContextDeleteRoomBestEffort ¶
func JobContextDeleteRoomBestEffort(ctx context.Context, api DeleteRoomAPI, job *Job, roomName string) (*DeleteRoomResponse, error)
type EntrypointResult ¶
type EntrypointResult struct {
Status lkprotocol.JobStatus
Err error
Recovered any
}
func RunEntrypoint ¶
func RunEntrypoint(entrypoint func() error) (result EntrypointResult)
func RunJobEntrypointLifecycle ¶
func RunJobEntrypointLifecycle(opts JobEntrypointLifecycleOptions) EntrypointResult
func RunReloadedJobEntrypointLifecycle ¶
func RunReloadedJobEntrypointLifecycle(opts ReloadedJobEntrypointLifecycleOptions) EntrypointResult
func RunServerJobEntrypointLifecycle ¶
func RunServerJobEntrypointLifecycle(opts JobEntrypointLifecycleOptions) EntrypointResult
func RunServerReloadedJobEntrypointLifecycle ¶
func RunServerReloadedJobEntrypointLifecycle(opts ReloadedJobEntrypointLifecycleOptions) EntrypointResult
type Job ¶
type Job = lkprotocol.Job
type JobAPI ¶
type JobAPI struct {
RoomService JobRoomServiceAPI
SIP JobSIPAPI
}
type JobAcceptArguments ¶
type JobAcceptArguments struct {
Name string `json:"name"`
Identity string `json:"identity"`
Metadata string `json:"metadata"`
Attributes map[string]string `json:"attributes,omitempty"`
}
func AcceptPendingAssignment ¶
func AcceptPendingAssignment[T PendingAssignmentTimer]( pending map[string]JobAcceptArguments, timers map[string]T, jobID string, ) (JobAcceptArguments, bool)
func AcceptServerPendingAssignment ¶
func AcceptServerPendingAssignment[T PendingAssignmentTimer]( pending map[string]JobAcceptArguments, timers map[string]T, jobID string, ) (JobAcceptArguments, bool)
func CloneJobAcceptArguments ¶
func CloneJobAcceptArguments(args JobAcceptArguments) JobAcceptArguments
func FromIPCJobAcceptArguments ¶
func FromIPCJobAcceptArguments(args workeripc.JobAcceptArguments) JobAcceptArguments
func JobAcceptArgumentsForJob ¶
func JobAcceptArgumentsForJob(job *lkprotocol.Job, args JobAcceptArguments) JobAcceptArguments
func PopPendingAccept ¶
func PopPendingAccept(pending map[string]JobAcceptArguments, jobID string) (JobAcceptArguments, bool)
type JobAssignment ¶
type JobAssignment = lkprotocol.JobAssignment
type JobCompletionPlan ¶
type JobCompletionPlan struct {
Finish bool
WaitForShutdown bool
SendStatus bool
SendAfterFinish bool
}
func JobCompletionPlanForEntrypoint ¶
func JobCompletionPlanForEntrypoint(status lkprotocol.JobStatus, terminated bool) JobCompletionPlan
type JobEntrypointLifecycleOptions ¶
type JobEntrypointLifecycleOptions struct {
Context context.Context
Entrypoint func() error
MarkDone func()
OnResult func(EntrypointResult)
Terminated func() bool
ShutdownDone <-chan struct{}
Shutdown func(string)
Finish func() bool
SendStatus func(lkprotocol.JobStatus) error
}
type JobFinishPlanResult ¶
func JobFinishPlan ¶
func JobFinishPlan(job *lkprotocol.Job) JobFinishPlanResult
func ServerJobFinishPlan ¶
func ServerJobFinishPlan(job *lkprotocol.Job) JobFinishPlanResult
type JobRejectArguments ¶
type JobRejectArguments struct {
Terminate bool
}
func DefaultJobRejectArguments ¶
func DefaultJobRejectArguments() JobRejectArguments
type JobRequest ¶
type JobRequest struct {
Job *lkprotocol.Job
// contains filtered or unexported fields
}
func NewJobRequest ¶
func NewJobRequest( job *lkprotocol.Job, accept func(JobAcceptArguments) error, reject func(JobRejectArguments) error, ) *JobRequest
func (*JobRequest) Accept ¶
func (r *JobRequest) Accept(args ...JobAcceptArguments) error
func (*JobRequest) AgentName ¶
func (r *JobRequest) AgentName() string
func (*JobRequest) ID ¶
func (r *JobRequest) ID() string
func (*JobRequest) Publisher ¶
func (r *JobRequest) Publisher() *lkprotocol.ParticipantInfo
func (*JobRequest) Reject ¶
func (r *JobRequest) Reject(args ...JobRejectArguments) error
func (*JobRequest) Room ¶
func (r *JobRequest) Room() *lkprotocol.Room
type JobRoomServiceAPI ¶
type JobRoomServiceAPI interface {
DeleteRoom(context.Context, *lkprotocol.DeleteRoomRequest) (*lkprotocol.DeleteRoomResponse, error)
MoveParticipant(context.Context, *lkprotocol.MoveParticipantRequest) (*lkprotocol.MoveParticipantResponse, error)
}
type JobSIPAPI ¶
type JobSIPAPI interface {
CreateSIPParticipant(context.Context, *lkprotocol.CreateSIPParticipantRequest) (*lkprotocol.SIPParticipantInfo, error)
TransferSIPParticipant(context.Context, *lkprotocol.TransferSIPParticipantRequest) (*emptypb.Empty, error)
}
type JobSessionEndPlanOptions ¶
type JobSessionEndPlanOptions struct {
Job *lkprotocol.Job
TimeoutSeconds float64
}
type JobSessionEndPlanResult ¶
func JobSessionEndPlan ¶
func JobSessionEndPlan(opts JobSessionEndPlanOptions) JobSessionEndPlanResult
func ServerJobSessionEndPlan ¶
func ServerJobSessionEndPlan(opts JobSessionEndPlanOptions) JobSessionEndPlanResult
type JobSessionReportUploadPlanOptions ¶
type JobSessionReportUploadPlanOptions struct {
Job *lkprotocol.Job
FakeJob bool
Report *agent.SessionReport
URL string
APIKey string
APISecret string
AgentName string
}
type JobSessionReportUploadPlanResult ¶
type JobSessionReportUploadPlanResult struct {
Upload bool
JobID string
Report *agent.SessionReport
URL string
APIKey string
APISecret string
AgentName string
}
func JobSessionReportUploadPlan ¶
func JobSessionReportUploadPlan(opts JobSessionReportUploadPlanOptions) JobSessionReportUploadPlanResult
func ServerJobSessionReportUploadPlan ¶
func ServerJobSessionReportUploadPlan(opts JobSessionReportUploadPlanOptions) JobSessionReportUploadPlanResult
type JobStatus ¶
type JobStatus = lkprotocol.JobStatus
type JobTermination ¶
type JobTermination = lkprotocol.JobTermination
type JobTerminationPlan ¶
type JobTerminationPlan struct {
MarkTerminated bool
Shutdown bool
WaitEntrypoint bool
Finish bool
}
func JobTerminationPlanForActiveJob ¶
func JobTerminationPlanForActiveJob(exists bool) JobTerminationPlan
func ServerJobTerminationPlanForActiveJob ¶
func ServerJobTerminationPlanForActiveJob(exists bool) JobTerminationPlan
type LocalJobContextSetupPlanOptions ¶
type LocalJobContextSetupPlanOptions = LocalJobContextValueOptions
type LocalJobContextSetupPlanResult ¶
type LocalJobContextSetupPlanResult struct {
Job *lkprotocol.Job
AcceptIdentity string
Token string
FakeJob bool
InitRecording bool
RecordingOptions agent.RecordingOptions
SessionDirectory string
}
func LocalJobContextSetupPlan ¶
func LocalJobContextSetupPlan(opts LocalJobContextSetupPlanOptions) LocalJobContextSetupPlanResult
func ServerLocalJobContextSetupPlan ¶
func ServerLocalJobContextSetupPlan(opts LocalJobContextSetupPlanOptions) LocalJobContextSetupPlanResult
type LocalJobContextValuesResult ¶
type LocalJobContextValuesResult struct {
Job *lkprotocol.Job
ParticipantIdentity string
Token string
}
func LocalJobContextValues ¶
func LocalJobContextValues(opts LocalJobContextValueOptions) LocalJobContextValuesResult
type LocalJobExecutorPlanResult ¶
type LocalJobExecutorPlanResult = LocalJobRuntimeInfo
func LocalJobExecutorPlan ¶
func LocalJobExecutorPlan(job *lkprotocol.Job) LocalJobExecutorPlanResult
func ServerLocalJobExecutorPlan ¶
func ServerLocalJobExecutorPlan(job *lkprotocol.Job) LocalJobExecutorPlanResult
type LocalJobOptions ¶
type LocalJobOptions struct {
FakeJob bool
RoomInfo *lkprotocol.Room
Token string
RecordingOptions agent.RecordingOptions
SessionReportPath string
SessionDirectory string
}
func DefaultFakeLocalJobOptions ¶
func DefaultFakeLocalJobOptions() LocalJobOptions
func DefaultServerFakeLocalJobOptions ¶
func DefaultServerFakeLocalJobOptions() LocalJobOptions
type LocalJobRuntimeInfo ¶
func LocalJobInfo ¶
func LocalJobInfo(job *lkprotocol.Job) LocalJobRuntimeInfo
type LocalParticipant ¶
type LocalParticipant = lksdk.LocalParticipant
func JobContextLocalParticipant ¶
func JobContextLocalParticipant(room *SDKRoom) *LocalParticipant
type LocalRoomJobOptions ¶
type MetricInfo ¶
type MetricInfo struct {
RoomName string
}
func JobMetricInfo ¶
func JobMetricInfo(job *lkprotocol.Job) MetricInfo
type MoveParticipantAPI ¶
type MoveParticipantAPI interface {
MoveParticipant(context.Context, *lkprotocol.MoveParticipantRequest) (*lkprotocol.MoveParticipantResponse, error)
}
type MoveParticipantPlanResult ¶
type MoveParticipantPlanResult struct {
Skip bool
}
func JobContextMoveParticipantPlan ¶
func JobContextMoveParticipantPlan(fakeJob bool) MoveParticipantPlanResult
func MoveParticipantPlan ¶
func MoveParticipantPlan(fakeJob bool) MoveParticipantPlanResult
type ParticipantDetails ¶
type ParticipantDetails struct {
Identity string
Kind lkprotocol.ParticipantInfo_Kind
}
func ParticipantInfoDetails ¶
func ParticipantInfoDetails(participant *lkprotocol.ParticipantInfo) ParticipantDetails
type ParticipantEntrypointRegistrationOptions ¶
type ParticipantEntrypointRegistrationOptions struct {
Entrypoint uintptr
RegisteredEntrypoints []uintptr
Kinds []lkprotocol.ParticipantInfo_Kind
}
type ParticipantEntrypointRegistrationPlanResult ¶
type ParticipantEntrypointRegistrationPlanResult struct {
Kinds []lkprotocol.ParticipantInfo_Kind
}
func JobContextParticipantEntrypointRegistrationPlan ¶
func JobContextParticipantEntrypointRegistrationPlan(opts ParticipantEntrypointRegistrationOptions) (ParticipantEntrypointRegistrationPlanResult, error)
func ParticipantEntrypointRegistrationPlan ¶
func ParticipantEntrypointRegistrationPlan(opts ParticipantEntrypointRegistrationOptions) (ParticipantEntrypointRegistrationPlanResult, error)
type ParticipantEntrypointTaskPlanResult ¶
type ParticipantEntrypointTaskPlanResult struct {
Schedule bool
Participant ParticipantDetails
TaskKey ParticipantTaskKey
}
func JobContextParticipantEntrypointTaskPlan ¶
func JobContextParticipantEntrypointTaskPlan(participant *ParticipantInfo, kinds []ParticipantInfoKind, entrypoint uintptr) ParticipantEntrypointTaskPlanResult
func ParticipantEntrypointTaskPlan ¶
func ParticipantEntrypointTaskPlan(participant *lkprotocol.ParticipantInfo, kinds []lkprotocol.ParticipantInfo_Kind, entrypoint uintptr) ParticipantEntrypointTaskPlanResult
type ParticipantInfo ¶
type ParticipantInfo = lkprotocol.ParticipantInfo
func JobContextParticipantInfoFromRemoteParticipant ¶
func JobContextParticipantInfoFromRemoteParticipant(participant RemoteParticipantView) *ParticipantInfo
func JobContextPublisher ¶
func JobContextPublisher(job *Job) *ParticipantInfo
func JobContextUpsertParticipantInfo ¶
func JobContextUpsertParticipantInfo(participants []*ParticipantInfo, participant *ParticipantInfo) []*ParticipantInfo
type ParticipantInfoKind ¶
type ParticipantInfoKind = lkprotocol.ParticipantInfo_Kind
type ParticipantTaskKey ¶
func ParticipantEntrypointTaskKey ¶
func ParticipantEntrypointTaskKey(participant *lkprotocol.ParticipantInfo, entrypoint uintptr) ParticipantTaskKey
type PendingAssignmentTimer ¶
type PendingAssignmentTimer interface {
Stop() bool
}
type PlaybackFinishedEvent ¶
type PlaybackStartedEvent ¶
type PreConnectAudioBuffer ¶
type PreConnectAudioBuffer struct {
Timestamp time.Time
Frames []*model.AudioFrame
}
type PreConnectAudioHandler ¶
type PreConnectAudioHandler struct {
// contains filtered or unexported fields
}
func NewPreConnectAudioHandler ¶
func NewPreConnectAudioHandler(room *lksdk.Room, timeout time.Duration) *PreConnectAudioHandler
func (*PreConnectAudioHandler) Close ¶
func (h *PreConnectAudioHandler) Close()
func (*PreConnectAudioHandler) Register ¶
func (h *PreConnectAudioHandler) Register()
func (*PreConnectAudioHandler) WaitForData ¶
func (h *PreConnectAudioHandler) WaitForData(ctx context.Context, trackID string) []*model.AudioFrame
type PreparedRoomConnectOptions ¶
type PreparedRoomConnectOptions struct {
Room *lksdk.Room
URL string
Token string
Job *lkprotocol.Job
APIKey string
APISecret string
Accept ConnectInfoOptions
AutoSubscribe string
Connector RoomConnector
}
func PreparedRoomConnectOptionsFromAcceptedJob ¶
func PreparedRoomConnectOptionsFromAcceptedJob(opts AcceptedJobRoomConnectOptions) PreparedRoomConnectOptions
type RecorderIO ¶
type RecorderIO struct {
Session *agent.AgentSession
InputStartTime *time.Time
OutputStartTime *time.Time
// contains filtered or unexported fields
}
func NewRecorderIO ¶
func NewRecorderIO(session *agent.AgentSession) *RecorderIO
func (*RecorderIO) OutputPath ¶
func (r *RecorderIO) OutputPath() string
func (*RecorderIO) PopulateSessionReport ¶
func (r *RecorderIO) PopulateSessionReport(report *agent.SessionReport)
func (*RecorderIO) RecordInput ¶
func (r *RecorderIO) RecordInput(frame *model.AudioFrame)
func (*RecorderIO) RecordOutput ¶
func (r *RecorderIO) RecordOutput(frame *model.AudioFrame)
func (*RecorderIO) Recording ¶
func (r *RecorderIO) Recording() bool
func (*RecorderIO) RecordingStartedAt ¶
func (r *RecorderIO) RecordingStartedAt() *time.Time
func (*RecorderIO) Stop ¶
func (r *RecorderIO) Stop() error
type RegisterMessageInfo ¶
type RegisterMessageInfo struct {
WorkerID string
ServerInfo *lkprotocol.ServerInfo
}
type RegisterWorkerOptions ¶
type RegisterWorkerOptions struct {
JobType lkprotocol.JobType
AgentName string
Version string
Permissions WorkerPermissions
}
type ReloadedJobContextValueOptions ¶
type ReloadedJobContextValueOptions = RunningJobContextValueOptions
type ReloadedJobEntrypointLifecycleOptions ¶
type ReloadedJobEntrypointLifecycleOptions struct {
Context context.Context
Entrypoint func() error
MarkDone func()
OnResult func(EntrypointResult)
ShutdownDone <-chan struct{}
Shutdown func(string)
Finish func() bool
SendStatus func(lkprotocol.JobStatus) error
OnStatusSkipped func()
}
type RemoteParticipant ¶
type RemoteParticipant = lksdk.RemoteParticipant
func JobContextWaitForAgent ¶
func JobContextWaitForParticipant ¶
func JobContextWaitForParticipant(ctx context.Context, room *SDKRoom, identity string, kinds ...ParticipantInfoKind) (*RemoteParticipant, error)
type RemoteParticipantView ¶
type RemoteParticipantView interface {
SID() string
Identity() string
Name() string
Kind() lksdk.ParticipantKind
Metadata() string
Attributes() map[string]string
}
func JobContextRemoteParticipantViews ¶
func JobContextRemoteParticipantViews(room *SDKRoom) []RemoteParticipantView
func RemoteParticipantViews ¶
func RemoteParticipantViews(participants []*lksdk.RemoteParticipant) []RemoteParticipantView
func RoomRemoteParticipantViews ¶
func RoomRemoteParticipantViews(room *lksdk.Room) []RemoteParticipantView
type RemoteTrackPublication ¶
type RemoteTrackPublication = lksdk.RemoteTrackPublication
func JobContextWaitForTrackPublicationWithOptions ¶
func JobContextWaitForTrackPublicationWithOptions(ctx context.Context, room *SDKRoom, options TrackPublicationWaitOptions) (*RemoteTrackPublication, error)
type RemoteTrackSubscriptionResult ¶
func ApplyAutoSubscribeToRoom ¶
func ApplyAutoSubscribeToRoom(room *lksdk.Room, mode string) []RemoteTrackSubscriptionResult
func JobContextApplyAutoSubscribeToRoom ¶
func JobContextApplyAutoSubscribeToRoom(room *SDKRoom, mode string) []RemoteTrackSubscriptionResult
func SubscribeRemoteTrackIfAllowed ¶
func SubscribeRemoteTrackIfAllowed(mode string, publication RemoteTrackPublicationView) RemoteTrackSubscriptionResult
type RoomCallback ¶
type RoomCallback = lksdk.RoomCallback
func JobContextRoomCallbackWithHandlers ¶
func JobContextRoomCallbackWithHandlers(cb *RoomCallback, handlers RoomCallbackHandlers) *RoomCallback
type RoomCallbackHandlers ¶
type RoomCallbackHandlers struct {
AutoSubscribe string
OnDisconnected func()
OnDisconnectedWithReason func(lksdk.DisconnectionReason)
OnReconnecting func()
OnReconnected func()
OnRoomMoved func(roomName string, token string)
OnParticipantConnected func(RemoteParticipantView)
OnParticipantDisconnected func(RemoteParticipantView)
OnLocalTrackPublished func(*lksdk.LocalTrackPublication, *lksdk.LocalParticipant)
OnLocalTrackSubscribed func(*lksdk.LocalTrackPublication, *lksdk.LocalParticipant)
OnTrackSubscribed func(*webrtc.TrackRemote, *lksdk.RemoteTrackPublication, *lksdk.RemoteParticipant)
OnTrackUnpublished func(*lksdk.RemoteTrackPublication, *lksdk.RemoteParticipant)
OnTrackPublishedEvent func(*lksdk.RemoteTrackPublication, *lksdk.RemoteParticipant)
OnAttributesChanged func(map[string]string, lksdk.Participant)
OnIsSpeakingChanged func(lksdk.Participant)
OnDataPacket func(lksdk.DataPacket, lksdk.DataReceiveParams)
OnTrackSubscribeError func(RemoteTrackSubscriptionResult)
}
type RoomConnectOptions ¶
type RoomConnectOptions struct {
URL string
Token string
Job *lkprotocol.Job
APIKey string
APISecret string
Accept ConnectInfoOptions
AutoSubscribe string
Callback *lksdk.RoomCallback
Connector RoomConnector
}
type RoomConnectionStateChangedEvent ¶ added in v0.1.6
type RoomConnectionStateChangedEvent struct {
State string
}
func (*RoomConnectionStateChangedEvent) Type ¶ added in v0.1.6
func (*RoomConnectionStateChangedEvent) Type() string
type RoomConnector ¶
type RoomConnector struct {
ConnectWithToken func(string, string, *lksdk.RoomCallback, ...lksdk.ConnectOption) (*lksdk.Room, error)
Connect func(string, lksdk.ConnectInfo, *lksdk.RoomCallback, ...lksdk.ConnectOption) (*lksdk.Room, error)
JoinWithToken func(context.Context, *lksdk.Room, string, string, ...lksdk.ConnectOption) error
Join func(context.Context, *lksdk.Room, string, lksdk.ConnectInfo, ...lksdk.ConnectOption) error
}
type RoomDisconnectedEvent ¶ added in v0.1.6
type RoomDisconnectedEvent struct{}
func (*RoomDisconnectedEvent) Type ¶ added in v0.1.6
func (*RoomDisconnectedEvent) Type() string
type RoomIO ¶
type RoomIO struct {
Room *lksdk.Room
AgentSession *agent.AgentSession
Options RoomOptions
Recorder *RecorderIO
// contains filtered or unexported fields
}
func NewRoomIO ¶
func NewRoomIO(room *lksdk.Room, session *agent.AgentSession, opts RoomOptions) *RoomIO
func (*RoomIO) AttachRoom ¶
func (*RoomIO) AudioOutputDiagnostics ¶
func (rio *RoomIO) AudioOutputDiagnostics() RoomIOAudioOutputDiagnostics
func (*RoomIO) CanPauseAudioOutput ¶
func (*RoomIO) ClearBuffer ¶
func (rio *RoomIO) ClearBuffer()
func (*RoomIO) GetCallback ¶
func (rio *RoomIO) GetCallback() *lksdk.RoomCallback
func (*RoomIO) LinkedParticipant ¶
func (*RoomIO) OffPlaybackFinished ¶
func (rio *RoomIO) OffPlaybackFinished(callback func(PlaybackFinishedEvent))
func (*RoomIO) OffPlaybackStarted ¶
func (rio *RoomIO) OffPlaybackStarted(callback func(PlaybackStartedEvent))
func (*RoomIO) OnPlaybackFinished ¶
func (rio *RoomIO) OnPlaybackFinished(callback func(PlaybackFinishedEvent))
func (*RoomIO) OnPlaybackStarted ¶
func (rio *RoomIO) OnPlaybackStarted(callback func(PlaybackStartedEvent))
func (*RoomIO) PauseAudioOutput ¶
func (rio *RoomIO) PauseAudioOutput()
func (*RoomIO) PublishAudio ¶
func (*RoomIO) ResumeAudioOutput ¶
func (rio *RoomIO) ResumeAudioOutput()
func (*RoomIO) SetParticipant ¶
func (*RoomIO) UnsetParticipant ¶
func (rio *RoomIO) UnsetParticipant()
func (*RoomIO) WaitForPlayout ¶
func (rio *RoomIO) WaitForPlayout(ctx context.Context) (PlaybackFinishedEvent, error)
func (*RoomIO) WithCallback ¶ added in v0.1.6
func (rio *RoomIO) WithCallback(cb *lksdk.RoomCallback) *lksdk.RoomCallback
type RoomIOAudioOutputDiagnostics ¶
type RoomIOAudioOutputDiagnostics struct {
TrackID string
TrackPublished bool
TrackSubscribed bool
FramesReceived int
FramesPublished int
BytesReceived int
BytesPublished int
EncodedFramesPublished int
LastInputSampleRate uint32
LastInputSamplesPerChannel uint32
LastInputChannels uint32
LastPublishedSampleRate uint32
LastPublishedSamplesPerChan uint32
LastPublishedChannels uint32
LastFrameAt time.Time
LastPublishedAt time.Time
LastError string
LastErrorAt time.Time
}
type RoomLocalTrackPublishedEvent ¶ added in v0.1.6
type RoomLocalTrackPublishedEvent struct {
Publication *lksdk.LocalTrackPublication
Participant *lksdk.LocalParticipant
}
func (*RoomLocalTrackPublishedEvent) Type ¶ added in v0.1.6
func (*RoomLocalTrackPublishedEvent) Type() string
type RoomMovedEvent ¶ added in v0.1.6
func (*RoomMovedEvent) Type ¶ added in v0.1.6
func (*RoomMovedEvent) Type() string
type RoomOptions ¶
type RoomOptions struct {
AudioTrackName string
AudioSubscriptionTimeout time.Duration
PreConnectAudioTimeout time.Duration
DisablePreConnectAudio bool
DisableAudioInput bool
DisableTextInput bool
DisableAudioOutput bool
DisableTranscriptionOutput bool
TranscriptionJSONFormat bool
TranscriptionNextOutput TranscriptionTextOutput
DisableCloseOnDisconnect bool
DeleteRoomOnClose bool
DeleteRoom func(context.Context, string) error
TextInputCallback TextInputCallback
ParticipantIdentity string
ParticipantKinds []lksdk.ParticipantKind
}
type RoomParticipantActiveEvent ¶ added in v0.1.6
type RoomParticipantActiveEvent struct {
Participant lksdk.Participant
}
func (*RoomParticipantActiveEvent) Type ¶ added in v0.1.6
func (*RoomParticipantActiveEvent) Type() string
type RoomParticipantAttributesChangedEvent ¶ added in v0.1.6
type RoomParticipantAttributesChangedEvent struct {
Changed map[string]string
Participant lksdk.Participant
}
func (*RoomParticipantAttributesChangedEvent) Type ¶ added in v0.1.6
func (*RoomParticipantAttributesChangedEvent) Type() string
type RoomParticipantConnectedEvent ¶ added in v0.1.6
type RoomParticipantConnectedEvent struct {
Participant *lksdk.RemoteParticipant
}
func (*RoomParticipantConnectedEvent) Type ¶ added in v0.1.6
func (*RoomParticipantConnectedEvent) Type() string
type RoomParticipantDisconnectedEvent ¶ added in v0.1.6
type RoomParticipantDisconnectedEvent struct {
Participant *lksdk.RemoteParticipant
}
func (*RoomParticipantDisconnectedEvent) Type ¶ added in v0.1.6
func (*RoomParticipantDisconnectedEvent) Type() string
type RoomSipDTMFReceivedEvent ¶ added in v0.1.6
type RoomSipDTMFReceivedEvent struct {
Event *livekit.SipDTMF
Params lksdk.DataReceiveParams
}
func (*RoomSipDTMFReceivedEvent) Type ¶ added in v0.1.6
func (*RoomSipDTMFReceivedEvent) Type() string
type RoomTrackPublishedEvent ¶ added in v0.1.6
type RoomTrackPublishedEvent struct {
Publication *lksdk.RemoteTrackPublication
Participant *lksdk.RemoteParticipant
}
func (*RoomTrackPublishedEvent) Type ¶ added in v0.1.6
func (*RoomTrackPublishedEvent) Type() string
type RoomTrackSubscribedEvent ¶ added in v0.1.6
type RoomTrackSubscribedEvent struct {
Track *webrtc.TrackRemote
Publication *lksdk.RemoteTrackPublication
Participant *lksdk.RemoteParticipant
}
func (*RoomTrackSubscribedEvent) Type ¶ added in v0.1.6
func (*RoomTrackSubscribedEvent) Type() string
type RoomTrackUnpublishedEvent ¶ added in v0.1.6
type RoomTrackUnpublishedEvent struct {
Publication *lksdk.RemoteTrackPublication
Participant *lksdk.RemoteParticipant
}
func (*RoomTrackUnpublishedEvent) Type ¶ added in v0.1.6
func (*RoomTrackUnpublishedEvent) Type() string
type RunningJobContextValueOptions ¶
type RunningJobContextValueOptions struct {
Info RunningJobInfo
OverrideURL string
DefaultWorkerID string
}
type RunningJobContextValuesResult ¶
type RunningJobContextValuesResult struct {
Job *lkprotocol.Job
JobID string
URL string
Token string
WorkerID string
AcceptArguments JobAcceptArguments
FakeJob bool
EnableRecording bool
}
func ReloadedJobContextValues ¶
func ReloadedJobContextValues(opts ReloadedJobContextValueOptions) RunningJobContextValuesResult
func RunningJobContextValues ¶
func RunningJobContextValues(opts RunningJobContextValueOptions) RunningJobContextValuesResult
func ServerReloadedJobContextValues ¶
func ServerReloadedJobContextValues(opts ReloadedJobContextValueOptions) RunningJobContextValuesResult
func ServerRunningJobContextValues ¶
func ServerRunningJobContextValues(opts RunningJobContextValueOptions) RunningJobContextValuesResult
type RunningJobEntrypointLifecycleOptions ¶
type RunningJobEntrypointLifecycleOptions struct {
Context context.Context
Entrypoint func() error
MarkStarted func()
MarkDone func()
ShutdownDone <-chan struct{}
Shutdown func(string)
WaitEntrypointDone func(time.Duration) bool
CloseWait time.Duration
Finish func() bool
OnPanic func(any)
OnError func(error)
OnCancelTimeout func()
}
type RunningJobInfo ¶
type RunningJobInfo struct {
AcceptArguments JobAcceptArguments `json:"accept_arguments"`
Job *lkprotocol.Job `json:"job"`
URL string `json:"url"`
Token string `json:"token"`
WorkerID string `json:"worker_id"`
FakeJob bool `json:"fake_job"`
}
func CloneRunningJobInfo ¶
func CloneRunningJobInfo(info RunningJobInfo) RunningJobInfo
func FromIPCRunningJobInfo ¶
func FromIPCRunningJobInfo(info workeripc.RunningJobInfo) (RunningJobInfo, error)
func FromIPCRunningJobInfos ¶
func FromIPCRunningJobInfos(infos []workeripc.RunningJobInfo) ([]RunningJobInfo, error)
func RefreshRunningJobTokenForReload ¶
func RefreshRunningJobTokenForReload(info RunningJobInfo, apiSecret string, now time.Time) (RunningJobInfo, error)
func RefreshRunningJobsForReload ¶
func RefreshRunningJobsForReload(jobs []RunningJobInfo, apiSecret string, now time.Time) ([]RunningJobInfo, error)
func RefreshServerRunningJobsForReload ¶
func RefreshServerRunningJobsForReload(jobs []RunningJobInfo, apiSecret string, now time.Time) ([]RunningJobInfo, error)
func RunningJobInfoFromEnv ¶
func RunningJobInfoFromEnv(env map[string]string) (RunningJobInfo, error)
func RunningJobInfoSnapshot ¶
func RunningJobInfoSnapshot(opts RunningJobInfoOptions) RunningJobInfo
func ServerRunningJobInfoSnapshot ¶
func ServerRunningJobInfoSnapshot(opts RunningJobInfoOptions) RunningJobInfo
type RunningJobInfoOptions ¶
type RunningJobInfoOptions struct {
AcceptArguments JobAcceptArguments
Job *lkprotocol.Job
URL string
Token string
WorkerID string
FakeJob bool
}
type RuntimeJobInfo ¶
func JobRuntimeInfo ¶
func JobRuntimeInfo(job *lkprotocol.Job) RuntimeJobInfo
type SDKRoom ¶
func NewJobContextRoom ¶
func NewJobContextRoom(cb *RoomCallback) *SDKRoom
func NewRoom ¶
func NewRoom(cb *RoomCallback) *SDKRoom
type SIPAPI ¶
type SIPAPI interface {
CreateSIPParticipant(context.Context, *lkprotocol.CreateSIPParticipantRequest) (*lkprotocol.SIPParticipantInfo, error)
TransferSIPParticipant(context.Context, *lkprotocol.TransferSIPParticipantRequest) (*emptypb.Empty, error)
}
type SIPCreateParticipantPlanResult ¶
type SIPCreateParticipantPlanResult struct {
Skip bool
Info *lkprotocol.SIPParticipantInfo
}
func JobContextSIPCreateParticipantPlan ¶
func JobContextSIPCreateParticipantPlan(fakeJob bool) SIPCreateParticipantPlanResult
func SIPCreateParticipantPlan ¶
func SIPCreateParticipantPlan(fakeJob bool) SIPCreateParticipantPlanResult
type SIPCreateParticipantRequest ¶
type SIPCreateParticipantRequest = lkprotocol.CreateSIPParticipantRequest
type SIPParticipantInfo ¶
type SIPParticipantInfo = lkprotocol.SIPParticipantInfo
func JobContextCreateSIPParticipantWithRequest ¶
func JobContextCreateSIPParticipantWithRequest(ctx context.Context, api SIPAPI, req *SIPCreateParticipantRequest) (*SIPParticipantInfo, error)
type SIPTransferParticipantPlanResult ¶
type SIPTransferParticipantPlanResult struct {
Skip bool
}
func JobContextSIPTransferParticipantPlan ¶
func JobContextSIPTransferParticipantPlan(fakeJob bool) SIPTransferParticipantPlanResult
func SIPTransferParticipantPlan ¶
func SIPTransferParticipantPlan(fakeJob bool) SIPTransferParticipantPlanResult
type ServerConnectionEnvOptions ¶
type ServerConnectionEnvOptions struct {
ServerConnectionOptions
Setenv func(string, string) error
}
type ServerConnectionOptions ¶
type ServerConnectionResolveOptions ¶
type ServerConnectionResolveOptions = WorkerConnectionOptions
type ServerInfo ¶
type ServerInfo = lkprotocol.ServerInfo
type ServerMessage ¶
type ServerMessage = lkprotocol.ServerMessage
func ExchangeInitialServerRegisterWebSocket ¶
func ExchangeInitialServerRegisterWebSocket(conn WorkerRegisterWebSocket, msg *WorkerMessage) (*ServerMessage, error)
type ServerMessageDispatchInfo ¶
type ServerMessageDispatchInfo struct {
Kind ServerMessageKind
Register RegisterMessageInfo
Availability *lkprotocol.AvailabilityRequest
Assignment *JobAssignment
Termination *JobTermination
}
func ServerMessageDispatch ¶
func ServerMessageDispatch(msg *lkprotocol.ServerMessage) ServerMessageDispatchInfo
type ServerMessageKind ¶
type ServerMessageKind string
const ( ServerMessageKindUnknown ServerMessageKind = "unknown" ServerMessageKindRegister ServerMessageKind = "register" ServerMessageKindAvailability ServerMessageKind = "availability" ServerMessageKindAssignment ServerMessageKind = "assignment" ServerMessageKindTermination ServerMessageKind = "termination" )
func RouteServerMessage ¶
func RouteServerMessage(opts ServerMessageRouteOptions) ServerMessageKind
func RouteServerWorkerMessage ¶
func RouteServerWorkerMessage(opts ServerMessageRouteOptions) ServerMessageKind
type ServerMessageRouteOptions ¶
type ServerMessageRouteOptions struct {
Message *lkprotocol.ServerMessage
OnRegister func(WorkerRegisteredEvent)
OnAvailability func(*lkprotocol.AvailabilityRequest)
OnAssignment func(*JobAssignment)
OnTermination func(*JobTermination)
OnUnknown func()
}
type ServerRegisterWorkerMessageOptions ¶
type ServerRegisterWorkerMessageOptions struct {
WorkerType WorkerType
AgentName string
Version string
Permissions *WorkerPermissions
}
type SessionReportInfo ¶
func JobSessionReportInfo ¶
func JobSessionReportInfo(job *lkprotocol.Job) SessionReportInfo
type TerminationInfo ¶
type TerminationInfo struct {
JobID string
}
func JobTerminationInfo ¶
func JobTerminationInfo(req *JobTermination) TerminationInfo
type TextInputCallback ¶
type TextInputCallback func(context.Context, *agent.AgentSession, TextInputEvent) error
type TextInputEvent ¶
type TextInputEvent struct {
Text string
Info lksdk.TextStreamInfo
ParticipantIdentity string
}
type TrackPublicationWaitOptions ¶
type TrackPublicationWaitOptions = utils.TrackPublicationWaitOptions
type TrackType ¶
type TrackType = lkprotocol.TrackType
type TranscriptionTextOutput ¶ added in v0.1.6
type WorkerConnect ¶
func WorkerConnectInfo ¶
func WorkerConnectInfo(opts WorkerConnectOptions) (WorkerConnect, error)
type WorkerConnectOptions ¶
type WorkerConnectionOptions ¶
type WorkerConnectionOptions struct {
WSURL string
LegacyWSURL string
APIKey string
APISecret string
WorkerToken string
AgentName string
AgentNameIsEnv bool
Getenv func(string) string
}
func ResolveServerConnectionOptions ¶
func ResolveServerConnectionOptions(opts ServerConnectionResolveOptions) WorkerConnectionOptions
func ResolveWorkerConnectionOptions ¶
func ResolveWorkerConnectionOptions(opts WorkerConnectionOptions) WorkerConnectionOptions
type WorkerEnvOptions ¶
type WorkerMessage ¶
type WorkerMessage = lkprotocol.WorkerMessage
func ServerAvailableWorkerStatusMessage ¶
func ServerAvailableWorkerStatusMessage(opts ServerAvailableWorkerStatusMessageOptions) *WorkerMessage
func ServerDrainingWorkerStatusMessage ¶
func ServerDrainingWorkerStatusMessage(jobCount uint32) *WorkerMessage
func ServerJobRunningMessage ¶
func ServerJobRunningMessage(jobID string) *WorkerMessage
func ServerJobStatusMessage ¶
func ServerJobStatusMessage(jobID string, status JobStatus) *WorkerMessage
func ServerMigrateRunningJobsMessage ¶
func ServerMigrateRunningJobsMessage(jobs []RunningJobInfo) *WorkerMessage
func ServerRegisterWorkerMessage ¶
func ServerRegisterWorkerMessage(opts ServerRegisterWorkerMessageOptions) *WorkerMessage
type WorkerMessageLoopOptions ¶
type WorkerMessageLoopOptions struct {
Reader WorkerWebSocketReader
Close func() error
Handle func(*lkprotocol.ServerMessage)
OnDecodeError func(error)
}
type WorkerMetadataOptions ¶
type WorkerMetadataResponse ¶
type WorkerMetadataResponse struct {
AgentName string `json:"agent_name"`
AgentNameIsEnv bool `json:"agent_name_is_env"`
WorkerType string `json:"worker_type"`
WorkerLoad float64 `json:"worker_load"`
ActiveJobs int `json:"active_jobs"`
SDKVersion string `json:"sdk_version"`
ProtocolVersion int `json:"protocol_version"`
ProjectType string `json:"project_type"`
NodeName string `json:"node_name"`
Hosted bool `json:"hosted"`
}
func WorkerMetadata ¶
func WorkerMetadata(opts WorkerMetadataOptions) WorkerMetadataResponse
func WorkerRuntimeMetadata ¶
func WorkerRuntimeMetadata(opts WorkerRuntimeMetadataOptions) WorkerMetadataResponse
type WorkerPermissions ¶
type WorkerPermissions struct {
CanPublish bool
CanSubscribe bool
CanPublishData bool
CanUpdateMetadata bool
CanPublishSources []lkprotocol.TrackSource
Hidden bool
}
func DefaultServerWorkerPermissions ¶
func DefaultServerWorkerPermissions() *WorkerPermissions
func DefaultWorkerPermissions ¶
func DefaultWorkerPermissions() *WorkerPermissions
func ResolveWorkerPermissions ¶
func ResolveWorkerPermissions(permissions *WorkerPermissions) WorkerPermissions
type WorkerRegisterWebSocket ¶
type WorkerRegisterWebSocket interface {
WorkerMessageWebSocketWriter
ReadMessage() (int, []byte, error)
}
type WorkerRegisteredEvent ¶
type WorkerRegisteredEvent struct {
WorkerID string
ServerInfo *ServerInfo
}
func WorkerRegisteredEventFromRegisterDispatch ¶
func WorkerRegisteredEventFromRegisterDispatch(info RegisterMessageInfo) WorkerRegisteredEvent
type WorkerRegisteredHandler ¶
type WorkerRegisteredHandler func(workerID string, serverInfo *ServerInfo)
type WorkerRegistrationOptions ¶
type WorkerRegistrationOptions struct {
WorkerType string
AgentName string
Version string
Permissions *WorkerPermissions
}
type WorkerType ¶
type WorkerType string
const ( WorkerTypeRoom WorkerType = "room" WorkerTypePublisher WorkerType = "publisher" )
type WorkerWebSocketConnectOptions ¶
type WorkerWebSocketConnectOptions struct {
Dialer *websocket.Dialer
URL string
Headers http.Header
MaxRetry int
Dial WorkerWebSocketDialFunc
Sleep WorkerWebSocketSleepFunc
}
type WorkerWebSocketDialFunc ¶
type WorkerWebSocketOpenOptions ¶
type WorkerWebSocketOpenOptions struct {
WSURL string
WorkerToken string
APIKey string
APISecret string
TTL time.Duration
HTTPProxy string
MaxRetry int
Dial WorkerWebSocketDialFunc
Sleep WorkerWebSocketSleepFunc
}
type WorkerWebSocketOpenResult ¶
type WorkerWebSocketOpenResult struct {
Conn *websocket.Conn
Response *http.Response
ConnectFailed bool
}
func OpenServerWorkerWebSocket ¶
func OpenServerWorkerWebSocket(ctx context.Context, opts WorkerWebSocketOpenOptions) (WorkerWebSocketOpenResult, error)
func OpenWorkerWebSocket ¶
func OpenWorkerWebSocket(ctx context.Context, opts WorkerWebSocketOpenOptions) (WorkerWebSocketOpenResult, error)
type WorkerWebSocketReadFunc ¶
func (WorkerWebSocketReadFunc) ReadMessage ¶
func (fn WorkerWebSocketReadFunc) ReadMessage() (int, []byte, error)
type WorkerWebSocketReader ¶
Source Files
¶
- agent_identity.go
- auto_subscribe.go
- availability.go
- avatar_start_info.go
- client_events.go
- codec.go
- connect_info.go
- delete_room.go
- ipc_bridge.go
- job_api.go
- job_context_facade.go
- job_request.go
- local_job_options.go
- participant_info.go
- participant_kinds.go
- pre_connect_audio.go
- process_env.go
- recorder_io.go
- register_worker.go
- retry.go
- room_io.go
- server_connection.go
- server_message.go
- sip_participant.go
- sip_request.go
- token_claims.go
- wait.go
- worker_message.go
- worker_metadata.go
- worker_options.go
- worker_registered.go
- worker_type.go
- worker_url.go
Click to show internal directories.
Click to hide internal directories.