Documentation ¶
Index ¶
- Variables
- type LiveLobbyService
- func (s *LiveLobbyService) CloseLobbyHostConnection(ctx context.Context, stream *LiveStream, instanceId uuid.UUID) (bool, error)
- func (s *LiveLobbyService) CreateLobbyEgressEndpoint(ctx context.Context, sdp *webrtc.SessionDescription, stream *LiveStream, ...) (*webrtc.SessionDescription, string, error)
- func (s *LiveLobbyService) CreateLobbyHostIngressConnection(ctx context.Context, offer *webrtc.SessionDescription, stream *LiveStream, ...) (*webrtc.SessionDescription, string, error)
- func (s *LiveLobbyService) CreateLobbyHostPipeConnection(ctx context.Context, offer *webrtc.SessionDescription, stream *LiveStream, ...) (*webrtc.SessionDescription, string, error)
- func (s *LiveLobbyService) CreateLobbyIngressEndpoint(ctx context.Context, sdp *webrtc.SessionDescription, stream *LiveStream, ...) (*webrtc.SessionDescription, string, error)
- func (s *LiveLobbyService) CreateMainStreamLobbyEgressEndpoint(ctx context.Context, offer *webrtc.SessionDescription, stream *LiveStream, ...) (*webrtc.SessionDescription, error)
- func (s *LiveLobbyService) FinalCreateLobbyEgressEndpoint(ctx context.Context, offer *webrtc.SessionDescription, stream *LiveStream, ...) (bool, error)
- func (s *LiveLobbyService) InitLobbyEgressEndpoint(ctx context.Context, stream *LiveStream, userId uuid.UUID) (*webrtc.SessionDescription, error)
- func (s *LiveLobbyService) LeaveLobby(ctx context.Context, stream *LiveStream, userId uuid.UUID) (bool, error)
- func (s *LiveLobbyService) StartLiveStream(ctx context.Context, stream *LiveStream, streamInfo *LiveStreamInfo, ...) error
- func (s *LiveLobbyService) StopLiveStream(ctx context.Context, stream *LiveStream, userId uuid.UUID) error
- type LiveStream
- type LiveStreamInfo
- type LiveStreamRepository
- func (r *LiveStreamRepository) Add(ctx context.Context, liveStream *LiveStream) (string, error)
- func (r *LiveStreamRepository) AllBySpaceIdentifier(ctx context.Context, identifier string) ([]LiveStream, error)
- func (r *LiveStreamRepository) BuildGuestAccounts(ctx context.Context, actors []*models.Actor)
- func (r *LiveStreamRepository) Contains(ctx context.Context, streamUUID string) bool
- func (r *LiveStreamRepository) Delete(ctx context.Context, streamUUID string) error
- func (r *LiveStreamRepository) DeleteByUuid(ctx context.Context, streamUUID string) error
- func (r *LiveStreamRepository) FindByUuid(ctx context.Context, streamUUID string) (*LiveStream, error)
- func (r *LiveStreamRepository) Len(ctx context.Context) int64
- func (r *LiveStreamRepository) Update(ctx context.Context, stream *LiveStream) error
- func (r *LiveStreamRepository) UpsertLiveStream(ctx context.Context, stream *LiveStream) error
- type LiveStreamService
- func (ls *LiveStreamService) AllBySpaceIdentifier(ctx context.Context, identifier string) ([]LiveStream, error)
- func (ls *LiveStreamService) CreateStream(ctx context.Context, liveStream *LiveStream, identifier string, user string) (string, error)
- func (ls *LiveStreamService) CreateStreamAccessByVideo(ctx context.Context, video *models.Video) error
- func (ls *LiveStreamService) Delete(ctx context.Context, uuid string, user string) error
- func (ls *LiveStreamService) DeleteStreamAccessByVideo(ctx context.Context, iri string) error
- func (ls *LiveStreamService) FindByUuidAndSpaceIdentifier(ctx context.Context, uuid string, identifier string) (*LiveStream, error)
- func (ls *LiveStreamService) UpdateStream(ctx context.Context, liveStream *LiveStream, identifier string, user string) error
- func (ls *LiveStreamService) UpdateStreamAccessByVideo(ctx context.Context, video *models.Video) error
- type LiveStreamStatus
- type LiveStreamStatusValue
- type Space
- type SpaceManager
- type SpaceRepository
- func (r *SpaceRepository) Add(ctx context.Context, space *Space) (string, error)
- func (r *SpaceRepository) CreateWithIdentifier(ctx context.Context, identifier string) (*Space, error)
- func (r *SpaceRepository) Delete(ctx context.Context, identifier string) error
- func (r *SpaceRepository) GetByIdentifier(ctx context.Context, identifier string) (*Space, error)
- func (r *SpaceRepository) Len(ctx context.Context) int64
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrLobbyNotActive = errors.New("lobby not active")
View Source
var ErrSpaceNotFound = errors.New("reading unknown space in store")
View Source
var ErrStreamNotFound = errors.New("reading unknown live stream from store")
Functions ¶
This section is empty.
Types ¶
type LiveLobbyService ¶
type LiveLobbyService struct {
// contains filtered or unexported fields
}
func NewLiveLobbyService ¶
func NewLiveLobbyService(store storage, lobbyManager liveLobbyManager) *LiveLobbyService
func (*LiveLobbyService) CloseLobbyHostConnection ¶
func (s *LiveLobbyService) CloseLobbyHostConnection(ctx context.Context, stream *LiveStream, instanceId uuid.UUID) (bool, error)
CloseLobbyHostConnection Deprecated: Because the Endpoint API is getting simpler
func (*LiveLobbyService) CreateLobbyEgressEndpoint ¶
func (s *LiveLobbyService) CreateLobbyEgressEndpoint(ctx context.Context, sdp *webrtc.SessionDescription, stream *LiveStream, userId uuid.UUID) (*webrtc.SessionDescription, string, error)
func (*LiveLobbyService) CreateLobbyHostIngressConnection ¶
func (s *LiveLobbyService) CreateLobbyHostIngressConnection(ctx context.Context, offer *webrtc.SessionDescription, stream *LiveStream, instanceId uuid.UUID) (*webrtc.SessionDescription, string, error)
CreateLobbyHostIngressConnection Deprecated: Because the Endpoint API is getting simpler
func (*LiveLobbyService) CreateLobbyHostPipeConnection ¶
func (s *LiveLobbyService) CreateLobbyHostPipeConnection(ctx context.Context, offer *webrtc.SessionDescription, stream *LiveStream, instanceId uuid.UUID) (*webrtc.SessionDescription, string, error)
CreateLobbyHostPipeConnection Deprecated: Because the Endpoint API is getting simpler
func (*LiveLobbyService) CreateLobbyIngressEndpoint ¶
func (s *LiveLobbyService) CreateLobbyIngressEndpoint(ctx context.Context, sdp *webrtc.SessionDescription, stream *LiveStream, userId uuid.UUID) (*webrtc.SessionDescription, string, error)
func (*LiveLobbyService) CreateMainStreamLobbyEgressEndpoint ¶
func (s *LiveLobbyService) CreateMainStreamLobbyEgressEndpoint(ctx context.Context, offer *webrtc.SessionDescription, stream *LiveStream, userId uuid.UUID) (*webrtc.SessionDescription, error)
CreateMainStreamLobbyEgressEndpoint Deprecated: Because the Endpoint API is getting simpler
func (*LiveLobbyService) FinalCreateLobbyEgressEndpoint ¶
func (s *LiveLobbyService) FinalCreateLobbyEgressEndpoint(ctx context.Context, offer *webrtc.SessionDescription, stream *LiveStream, userId uuid.UUID) (bool, error)
FinalCreateLobbyEgressEndpoint Deprecated: Because the Endpoint API is getting simpler
func (*LiveLobbyService) InitLobbyEgressEndpoint ¶
func (s *LiveLobbyService) InitLobbyEgressEndpoint(ctx context.Context, stream *LiveStream, userId uuid.UUID) (*webrtc.SessionDescription, error)
InitLobbyEgressEndpoint Deprecated: Because the Endpoint API is getting simpler
func (*LiveLobbyService) LeaveLobby ¶
func (s *LiveLobbyService) LeaveLobby(ctx context.Context, stream *LiveStream, userId uuid.UUID) (bool, error)
func (*LiveLobbyService) StartLiveStream ¶
func (s *LiveLobbyService) StartLiveStream(ctx context.Context, stream *LiveStream, streamInfo *LiveStreamInfo, userId uuid.UUID) error
func (*LiveLobbyService) StopLiveStream ¶
func (s *LiveLobbyService) StopLiveStream(ctx context.Context, stream *LiveStream, userId uuid.UUID) error
type LiveStream ¶
type LiveStream struct { VideoId string `json:"-" gorm:"not null;"` Video *models.Video `json:"-" gorm:"foreignKey:VideoId;constraint:OnUpdate:CASCADE,OnDelete:CASCADE;"` UUID uuid.UUID `json:"uuid" gorm:"not null;index;unique;"` Title string `json:"title" gorm:"-"` LobbyId uint `json:"-" gorm:"not null;"` Lobby *lobby.LobbyEntity `json:"-" gorm:"foreignKey:LobbyId;constraint:OnUpdate:CASCADE,OnDelete:CASCADE;"` SpaceId uint `json:"-" gorm:"not null;"` Space *Space `json:"-" gorm:"foreignKey:SpaceId;constraint:OnUpdate:CASCADE,OnDelete:CASCADE;"` AccountId uint `json:"-" gorm:"not null;"` Account *auth.Account `json:"-" gorm:"foreignKey:AccountId;constraint:OnUpdate:CASCADE,OnDelete:CASCADE;"` User string `json:"user"` ID uint `json:"-" gorm:"primaryKey"` CreatedAt time.Time `json:"-"` UpdatedAt time.Time `json:"-"` DeletedAt gorm.DeletedAt `json:"-" gorm:"index"` }
func NewLiveStream ¶
func NewLiveStream(account *auth.Account, lobbyEntity *lobby.LobbyEntity, space *Space, video *models.Video) *LiveStream
type LiveStreamInfo ¶
type LiveStreamRepository ¶
type LiveStreamRepository struct {
// contains filtered or unexported fields
}
func NewLiveStreamRepository ¶
func NewLiveStreamRepository(store storage) *LiveStreamRepository
func (*LiveStreamRepository) Add ¶
func (r *LiveStreamRepository) Add(ctx context.Context, liveStream *LiveStream) (string, error)
func (*LiveStreamRepository) AllBySpaceIdentifier ¶
func (r *LiveStreamRepository) AllBySpaceIdentifier(ctx context.Context, identifier string) ([]LiveStream, error)
func (*LiveStreamRepository) BuildGuestAccounts ¶
func (r *LiveStreamRepository) BuildGuestAccounts(ctx context.Context, actors []*models.Actor)
func (*LiveStreamRepository) Contains ¶
func (r *LiveStreamRepository) Contains(ctx context.Context, streamUUID string) bool
func (*LiveStreamRepository) Delete ¶
func (r *LiveStreamRepository) Delete(ctx context.Context, streamUUID string) error
func (*LiveStreamRepository) DeleteByUuid ¶
func (r *LiveStreamRepository) DeleteByUuid(ctx context.Context, streamUUID string) error
func (*LiveStreamRepository) FindByUuid ¶
func (r *LiveStreamRepository) FindByUuid(ctx context.Context, streamUUID string) (*LiveStream, error)
func (*LiveStreamRepository) Update ¶
func (r *LiveStreamRepository) Update(ctx context.Context, stream *LiveStream) error
func (*LiveStreamRepository) UpsertLiveStream ¶
func (r *LiveStreamRepository) UpsertLiveStream(ctx context.Context, stream *LiveStream) error
type LiveStreamService ¶
type LiveStreamService struct {
// contains filtered or unexported fields
}
func NewLiveStreamService ¶
func NewLiveStreamService(repo *LiveStreamRepository, spaceRepo *SpaceRepository) *LiveStreamService
func (*LiveStreamService) AllBySpaceIdentifier ¶
func (ls *LiveStreamService) AllBySpaceIdentifier(ctx context.Context, identifier string) ([]LiveStream, error)
func (*LiveStreamService) CreateStream ¶
func (ls *LiveStreamService) CreateStream(ctx context.Context, liveStream *LiveStream, identifier string, user string) (string, error)
func (*LiveStreamService) CreateStreamAccessByVideo ¶
func (*LiveStreamService) DeleteStreamAccessByVideo ¶
func (ls *LiveStreamService) DeleteStreamAccessByVideo(ctx context.Context, iri string) error
func (*LiveStreamService) FindByUuidAndSpaceIdentifier ¶
func (ls *LiveStreamService) FindByUuidAndSpaceIdentifier(ctx context.Context, uuid string, identifier string) (*LiveStream, error)
func (*LiveStreamService) UpdateStream ¶
func (ls *LiveStreamService) UpdateStream(ctx context.Context, liveStream *LiveStream, identifier string, user string) error
func (*LiveStreamService) UpdateStreamAccessByVideo ¶
type LiveStreamStatus ¶
type LiveStreamStatus struct {
Status LiveStreamStatusValue `json:"status"`
}
type LiveStreamStatusValue ¶
type LiveStreamStatusValue int
const ( LiveStreamStatusOnline LiveStreamStatusValue = iota + 1 LiveStreamStatusOffline )
type Space ¶
type Space struct { Identifier string `gorm:"not null;unique;"` ChannelId uint `json:"-" gorm:"not null"` Channel *models.Actor `json:"-" gorm:"foreignKey:ChannelId;constraint:OnUpdate:CASCADE,OnDelete:CASCADE;"` AccountId uint `json:"-" gorm:"not null;"` Account *auth.Account `json:"-" gorm:"foreignKey:AccountId;constraint:OnUpdate:CASCADE,OnDelete:CASCADE;"` gorm.Model }
type SpaceManager ¶
type SpaceManager struct {
// contains filtered or unexported fields
}
func NewSpaceManager ¶
func NewSpaceManager(store storage) *SpaceManager
type SpaceRepository ¶
type SpaceRepository struct {
// contains filtered or unexported fields
}
func NewSpaceRepository ¶
func NewSpaceRepository(store storage) *SpaceRepository
func (*SpaceRepository) CreateWithIdentifier ¶
func (*SpaceRepository) Delete ¶
func (r *SpaceRepository) Delete(ctx context.Context, identifier string) error
func (*SpaceRepository) GetByIdentifier ¶
Click to show internal directories.
Click to hide internal directories.