Documentation
¶
Index ¶
- Variables
- func MakeId() string
- type AbortEvent
- type ChatEvent
- type Client
- func (c *Client) Abort(id string)
- func (c *Client) Chat(kind, dest, value string) error
- func (c *Client) Close() error
- func (c *Client) CloseUpConn(id string) error
- func (c *Client) Connect(ctx context.Context, group string) error
- func (c *Client) GetGroupStatus(ctx context.Context, group string) (*GroupStatus, error)
- func (c *Client) GroupName() string
- func (c *Client) Join(ctx context.Context, group, username, password string) error
- func (c *Client) NewUpConn(id string, pc *webrtc.PeerConnection, label string) error
- func (c *Client) RTCConfiguration() *webrtc.Configuration
- func (c *Client) Request(request map[string][]string) error
- func (c *Client) SetAPI(api *webrtc.API)
- func (c *Client) SetDialer(dialer *websocket.Dialer)
- func (c *Client) SetHTTPClient(hc *http.Client)
- func (c *Client) UserMessage(dest string, kind string, value any) error
- func (c *Client) Write(m *Message) error
- type CloseEvent
- type DownConnEvent
- type DownTrackEvent
- type GroupStatus
- type JoinedEvent
- type Message
- type UserEvent
- type UserMessageEvent
Constants ¶
This section is empty.
Variables ¶
var Debug bool
Functions ¶
Types ¶
type AbortEvent ¶
type AbortEvent struct {
Id string
}
AbortEvent indicates that we have closed an up connection.
type ChatEvent ¶
type ChatEvent struct {
Kind, Id, Source, Username, Dest string
Privileged bool
Time string
Value string
History bool
}
ChatEvent indicates that we received a chat message.
type Client ¶
Client represents a client-side connection.
func NewClient ¶
func NewClient() *Client
NewClient creates a new client connection. Use *Client.Connect to actually connect to the server.
func (*Client) CloseUpConn ¶
CloseUpConn closes a sending connection.
func (*Client) GetGroupStatus ¶
GetGroupStatus returns the status dictionary for a group. This might cache values for up to 60s.
func (*Client) GroupName ¶
GroupName returns the name of the group that we have joined, or the empty string.
func (*Client) RTCConfiguration ¶
func (c *Client) RTCConfiguration() *webrtc.Configuration
RTCConfiguration returns the configuration suggested by the server.
func (*Client) SetAPI ¶
func (c *Client) SetAPI(api *webrtc.API)
SetAPI sets the webrtc.API used for creating peer connections If this is not called, Pion's default API will be used.
func (*Client) SetDialer ¶
SetDialer sets the websocket.Dialer used for connecting to the server If this is not called, websocket.DefaultDialer will be used.
func (*Client) SetHTTPClient ¶
SetHTTPClient sets the http.Client used for HTTP requests If this is not called, http.DefaultClient will be used.
func (*Client) UserMessage ¶
UserMessage sends a "usermessage" to the server.
type CloseEvent ¶
type CloseEvent struct {
Id string
}
CloseEvent indicates that the server has closed a down connection.
type DownConnEvent ¶
type DownConnEvent struct { Id string Conn *webrtc.PeerConnection }
DownConnEvent indicates that we have received a new down connection.
type DownTrackEvent ¶
type DownTrackEvent struct { Id string Track *webrtc.TrackRemote Receiver *webrtc.RTPReceiver }
DownTrackEvent indicates that we have received a new down track.
type GroupStatus ¶
type GroupStatus struct { Name string `json:"name"` Redirect string `json:"redirect,omitempty"` Location string `json:"location,omitempty"` Endpoint string `json:"endpoint,omitempty"` DisplayName string `json:"displayName,omitempty"` Description string `json:"description,omitempty"` AuthServer string `json:"authServer,omitempty"` AuthPortal string `json:"authPortal,omitempty"` Locked bool `json:"locked,omitempty"` ClientCount *int `json:"clientCount,omitempty"` CanChangePassword bool `json:"canChangePassword,omitempty"` }
GroupStatus is a group status, as returned by the server.
type JoinedEvent ¶
JoinedEvent indicates that we either joined or left a group.
type Message ¶
type Message struct { Type string `json:"type"` Version []string `json:"version,omitempty"` Kind string `json:"kind,omitempty"` Error string `json:"error,omitempty"` Id string `json:"id,omitempty"` Replace string `json:"replace,omitempty"` Source string `json:"source,omitempty"` Dest string `json:"dest,omitempty"` Username *string `json:"username,omitempty"` Password string `json:"password,omitempty"` Token string `json:"token,omitempty"` Privileged bool `json:"privileged,omitempty"` Permissions []string `json:"permissions,omitempty"` Status *GroupStatus `json:"status,omitempty"` Data map[string]interface{} `json:"data,omitempty"` Group string `json:"group,omitempty"` Value interface{} `json:"value,omitempty"` NoEcho bool `json:"noecho,omitempty"` Time string `json:"time,omitempty"` SDP string `json:"sdp,omitempty"` Candidate *webrtc.ICECandidateInit `json:"candidate,omitempty"` Label string `json:"label,omitempty"` Request interface{} `json:"request,omitempty"` RTCConfiguration *webrtc.Configuration `json:"rtcConfiguration,omitempty"` }
Message is a message of Galene's protocol.
type UserMessageEvent ¶
UserMessageEvent indicates that we have received a "usermessage".