lobby

package
v0.0.0-...-4c68550 Latest Latest
Warning

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

Go to latest
Published: Apr 13, 2024 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNoSession            = errors.New("no session exists")
	ErrSessionAlreadyExists = errors.New("session already exists")
	ErrLobbyClosed          = errors.New("lobby already closed")
)

Functions

This section is empty.

Types

type LobbyEntity

type LobbyEntity struct {
	LiveStreamId uuid.UUID `json:"streamId"`
	UUID         uuid.UUID `json:"-"`
	Space        string
	IsRunning    bool   `json:"isLobbyRunning"`
	IsLive       bool   `json:"isLive"`
	Host         string `json:"-"`
	gorm.Model
}

func NewLobbyEntity

func NewLobbyEntity(streamID uuid.UUID, space string, shigHost string) *LobbyEntity

func (*LobbyEntity) GetHost

func (e *LobbyEntity) GetHost() string

func (*LobbyEntity) GetLiveStreamID

func (e *LobbyEntity) GetLiveStreamID() string

func (*LobbyEntity) GetSpace

func (e *LobbyEntity) GetSpace() string

func (LobbyEntity) TableName

func (LobbyEntity) TableName() string

type LobbyManager

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

func NewLobbyManager

func NewLobbyManager(storage storage.Storage, e sessions.RtpEngine, homeUrl *url.URL, registerToken string) *LobbyManager

func (*LobbyManager) CloseLobbyHostPipe

func (m *LobbyManager) CloseLobbyHostPipe(ctx context.Context, u uuid.UUID, id uuid.UUID) (bool, error)

CloseLobbyHostPipe Deprecated: Because the Endpoint API is getting simpler

func (*LobbyManager) CreateLobbyHostIngress

func (m *LobbyManager) CreateLobbyHostIngress(ctx context.Context, u uuid.UUID, offer *webrtc.SessionDescription, instanceId uuid.UUID) (struct {
	Answer       *webrtc.SessionDescription
	Resource     uuid.UUID
	RtpSessionId uuid.UUID
}, error)

CreateLobbyHostIngress Deprecated: Because the Endpoint API is getting simpler

func (*LobbyManager) CreateLobbyHostPipe

func (m *LobbyManager) CreateLobbyHostPipe(ctx context.Context, u uuid.UUID, offer *webrtc.SessionDescription, instanceId uuid.UUID) (struct {
	Answer       *webrtc.SessionDescription
	Resource     uuid.UUID
	RtpSessionId uuid.UUID
}, error)

CreateLobbyHostPipe Deprecated: Because the Endpoint API is getting simpler

func (*LobbyManager) CreateLobbyIngressEndpoint

func (m *LobbyManager) CreateLobbyIngressEndpoint(ctx context.Context, lobbyId uuid.UUID, user uuid.UUID, offer *webrtc.SessionDescription) (struct {
	Answer       *webrtc.SessionDescription
	Resource     uuid.UUID
	RtpSessionId uuid.UUID
}, error)

CreateLobbyIngressEndpoint Deprecated: Because the Endpoint API is getting simpler

func (*LobbyManager) CreateMainStreamLobbyEgressEndpoint

func (m *LobbyManager) CreateMainStreamLobbyEgressEndpoint(ctx context.Context, lobbyId uuid.UUID, user uuid.UUID, offer *webrtc.SessionDescription) (struct {
	Answer       *webrtc.SessionDescription
	RtpSessionId uuid.UUID
}, error)

CreateMainStreamLobbyEgressEndpoint Deprecated: Because the Endpoint API is getting simpler

func (*LobbyManager) FinalCreateLobbyEgressEndpoint

func (m *LobbyManager) FinalCreateLobbyEgressEndpoint(ctx context.Context, lobbyId uuid.UUID, user uuid.UUID, offer *webrtc.SessionDescription) (struct {
	Answer       *webrtc.SessionDescription
	Active       bool
	RtpSessionId uuid.UUID
}, error)

FinalCreateLobbyEgressEndpoint Deprecated: Because the Endpoint API is getting simpler

func (*LobbyManager) InitLobbyEgressEndpoint

func (m *LobbyManager) InitLobbyEgressEndpoint(ctx context.Context, lobbyId uuid.UUID, user uuid.UUID) (struct {
	Offer        *webrtc.SessionDescription
	Active       bool
	RtpSessionId uuid.UUID
}, error)

InitLobbyEgressEndpoint Deprecated: Because the Endpoint API is getting simpler

func (*LobbyManager) LeaveLobby

func (m *LobbyManager) LeaveLobby(ctx context.Context, lobbyId uuid.UUID, userId uuid.UUID) (bool, error)

func (*LobbyManager) NewEgressResource

func (m *LobbyManager) NewEgressResource(ctx context.Context, lobbyId uuid.UUID, user uuid.UUID, offer *webrtc.SessionDescription, option ...resources.Option) (*resources.WebRTC, error)

func (*LobbyManager) NewIngressResource

func (m *LobbyManager) NewIngressResource(ctx context.Context, lobbyId uuid.UUID, user uuid.UUID, offer *webrtc.SessionDescription, option ...resources.Option) (*resources.WebRTC, error)

func (*LobbyManager) StartLiveStream

func (m *LobbyManager) StartLiveStream(
	ctx context.Context,
	lobbyId uuid.UUID,
	key string,
	rtmpUrl string,
	userId uuid.UUID,
) error

func (*LobbyManager) StopLiveStream

func (m *LobbyManager) StopLiveStream(
	ctx context.Context,
	lobbyId uuid.UUID,
	userId uuid.UUID,
) error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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