client

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: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func WithSession

func WithSession(session *Session) func(client *Client)

func WithUrl

func WithUrl(apiUrl *url.URL) func(client *Client)

Types

type Client

type Client struct {
	Session *Session
	// contains filtered or unexported fields
}

func NewClient

func NewClient(options ...ClientOption) *Client

type ClientOption

type ClientOption func(*Client)

type HostApi

type HostApi struct {
	*Client
	UserId  string
	Token   string
	ShigUrl string
}

func NewHostApi

func NewHostApi(token string, opt ...ClientOption) *HostApi

func (*HostApi) PostHostOffer

func (a *HostApi) PostHostOffer(space string, stream string, offer *webrtc.SessionDescription) (*webrtc.SessionDescription, error)

type LobbyApi

type LobbyApi struct {
	*Client
	UserId  string
	Token   string
	ShigUrl string
}

func NewLobbyApi

func NewLobbyApi(userId string, token string, shigUrl string, opt ...ClientOption) *LobbyApi

func (*LobbyApi) Login

func (la *LobbyApi) Login() (*authentication.Token, error)

func (*LobbyApi) Start

func (la *LobbyApi) Start(spaceId string, streamId string, rtmpUrl string, key string) error

func (*LobbyApi) Status

func (la *LobbyApi) Status(spaceId string, streamId string) (string, error)

func (*LobbyApi) Stop

func (la *LobbyApi) Stop(spaceId string, streamId string) error

type Session

type Session struct {
	Bearer    string
	Cookie    *http.Cookie
	CsrfToken string
}

func (*Session) GetBearer

func (s *Session) GetBearer() string

func (*Session) GetCookie

func (s *Session) GetCookie() *http.Cookie

func (*Session) GetCsrfToken

func (s *Session) GetCsrfToken() string

func (*Session) SetBearer

func (s *Session) SetBearer(bearer string)

func (*Session) SetCookie

func (s *Session) SetCookie(cookie *http.Cookie)

func (*Session) SetCsrfToken

func (s *Session) SetCsrfToken(token string)

type Whep

type Whep struct {
	*Client
}

func NewWhep

func NewWhep(opt ...ClientOption) *Whep

func (*Whep) GetOffer

func (w *Whep) GetOffer(spaceId string, streamId string) (*webrtc.SessionDescription, error)

func (*Whep) SendAnswer

func (w *Whep) SendAnswer(spaceId string, streamId string, bearer string, answer *webrtc.SessionDescription) error

type Whip

type Whip struct {
	*Client
}

func NewWhip

func NewWhip(opt ...ClientOption) *Whip

func (*Whip) GetAnswer

func (w *Whip) GetAnswer(spaceId string, streamId string, offer *webrtc.SessionDescription) (*webrtc.SessionDescription, error)

Jump to

Keyboard shortcuts

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