Documentation ¶
Index ¶
- Constants
- func RandSeq(n int) string
- func WithDateProvider(dateProvider signer.DateProvier) func(*Client)
- func WithSigner(signer signer.APII) func(*Client)
- func WithWebsocketClient(websocket WebSocketClientI) func(*Client)
- type Client
- func (sc *Client) Close()
- func (sc *Client) OnClose(f func())
- func (sc *Client) OnError(f func(err error))
- func (sc *Client) OnIceCandidate(f func(iceCandidate *string, clientID *string))
- func (sc *Client) OnOpen(f func())
- func (sc *Client) OnSdpAnswer(f func(answer *string, clientID *string))
- func (sc *Client) OnSdpOffer(f func(offer *string, remoteClientID *string))
- func (sc *Client) Open() error
- func (sc *Client) SendIceCandidate(iceCandidateMsg string, recipientClientID *string)
- func (sc *Client) SendSdpAnswer(sdpAnswerMsg string, recipientClientID *string)
- func (sc *Client) SendSdpOffer(sdpOfferMsg string, recipientClientID *string)
- type Config
- type MessageType
- type ReadyStateType
- type Role
- type WebSocketClient
- func (ws *WebSocketClient) Close()
- func (ws *WebSocketClient) Dial() error
- func (ws *WebSocketClient) OnClose(f func())
- func (ws *WebSocketClient) OnError(f func(err error))
- func (ws *WebSocketClient) OnMessage(dial chan string, f func(messageType int, data []byte))
- func (ws *WebSocketClient) OnOpen(f func())
- func (ws *WebSocketClient) Send(msgType int, data []byte) error
- func (ws *WebSocketClient) SetURL(url string) error
- type WebSocketClientI
- type WebSocketSignalingMessageReceive
- type WebSocketSignalingMessageSend
Constants ¶
const (
DefaultClientID = "MASTER"
)
DefaultClientID value when it not exist
const TextMessage int = 1
For using webosocket text msg
Variables ¶
This section is empty.
Functions ¶
func WithDateProvider ¶
func WithDateProvider(dateProvider signer.DateProvier) func(*Client)
Use own Date Provider implementation
func WithSigner ¶
Use own v4 AWS signer implementation
func WithWebsocketClient ¶
func WithWebsocketClient(websocket WebSocketClientI) func(*Client)
Use own websocket client implementation
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Signaling client
func (*Client) OnIceCandidate ¶
On ICE Candidate Event Function
func (*Client) OnSdpAnswer ¶
On Sdp Answer Event Function
func (*Client) OnSdpOffer ¶
On Sdp Offer Event Function
func (*Client) SendIceCandidate ¶
Sender signaling Ice Candidate Messages
func (*Client) SendSdpAnswer ¶
Sender signaling Sdp Answer Messages
func (*Client) SendSdpOffer ¶
Sender signalingSdp Offer Messages
type Config ¶
type Config struct { ChannelARN *string // ARN AWS Signaling Channel ChannelEndpoint *string // WSS URL AWS signaling Region *string // AWS Region Role Role // Master or viewer actor ClientID *string // Id Client for AWS signaling protocol SystemClockOffset int // An offset value in milliseconds to apply to all signing times CredentialsValue *credentials.Value // AWS Credentials }
Signaling configure
type WebSocketClient ¶
type WebSocketClient struct {
// contains filtered or unexported fields
}
WebSocket Gorilla Client implementation
func (*WebSocketClient) Close ¶
func (ws *WebSocketClient) Close()
Close Function do websocket close gratefully
func (*WebSocketClient) OnClose ¶
func (ws *WebSocketClient) OnClose(f func())
On Close Event Function
func (*WebSocketClient) OnError ¶
func (ws *WebSocketClient) OnError(f func(err error))
OnError Event Function
func (*WebSocketClient) OnMessage ¶
func (ws *WebSocketClient) OnMessage(dial chan string, f func(messageType int, data []byte))
On OnMessage Event Function
func (*WebSocketClient) Send ¶
func (ws *WebSocketClient) Send(msgType int, data []byte) error
Function to send data to websocket
func (*WebSocketClient) SetURL ¶
func (ws *WebSocketClient) SetURL(url string) error
Set url of Websocket
type WebSocketClientI ¶
type WebSocketClientI interface { OnClose(func()) OnOpen(func()) OnError(func(err error)) Dial() error Close() OnMessage(chan string, func(messageType int, data []byte)) Send(int, []byte) error SetURL(string) error }
WebSocket API provides an interface to enable mock
type WebSocketSignalingMessageReceive ¶
type WebSocketSignalingMessageReceive struct { MessageType MessageType `json:"messageType,omitempty"` MessagePayload string `json:"messagePayload,omitempty"` SenderClientID string `json:"senderClientId,omitempty"` }
Signaling msg format for Reception
type WebSocketSignalingMessageSend ¶
type WebSocketSignalingMessageSend struct { MessageType MessageType `json:"action,omitempty"` MessagePayload string `json:"messagePayload,omitempty"` RecipientClientID string `json:"recipientClientId,omitempty"` }
Signaling msg format for Sending