Documentation
¶
Index ¶
- Constants
- Variables
- func EncodeWebRtcSignal(s *WebRtcSignal, dstPeer crypto.PubKey) ([]byte, error)
- func NewLinkUUID(transportType, localPeerID, remotePeerID peer.ID) uint64
- func NewTransportUUID(transportType string, peerID peer.ID) uint64
- type Config
- func (m *Config) CloneMessageVT() proto.Message
- func (m *Config) CloneVT() *Config
- func (*Config) Descriptor() ([]byte, []int)deprecated
- func (this *Config) EqualMessageVT(thatMsg proto.Message) bool
- func (this *Config) EqualVT(that *Config) bool
- func (c *Config) EqualsConfig(other config.Config) bool
- func (x *Config) GetAllPeers() bool
- func (x *Config) GetBackoff() *backoff.Backoff
- func (x *Config) GetBlockPeers() []string
- func (c *Config) GetConfigID() string
- func (c *Config) GetDebugVals() config.DebugValues
- func (x *Config) GetDialers() map[string]*dialer.DialerOpts
- func (x *Config) GetDisableListen() bool
- func (x *Config) GetQuic() *quic.Opts
- func (x *Config) GetSignalingId() string
- func (x *Config) GetTransportPeerId() string
- func (x *Config) GetTransportType() string
- func (x *Config) GetVerbose() bool
- func (x *Config) GetWebRtc() *WebRtcConfig
- func (m *Config) MarshalToSizedBufferVT(dAtA []byte) (int, error)
- func (m *Config) MarshalToVT(dAtA []byte) (int, error)
- func (m *Config) MarshalVT() (dAtA []byte, err error)
- func (c *Config) ParseBlockPeerIDs() ([]peer.ID, error)
- func (c *Config) ParseTransportPeerID() (peer.ID, error)
- func (*Config) ProtoMessage()
- func (x *Config) ProtoReflect() protoreflect.Message
- func (x *Config) Reset()
- func (c *Config) SetTransportPeerId(peerID string)
- func (m *Config) SizeVT() (n int)
- func (x *Config) String() string
- func (m *Config) UnmarshalVT(dAtA []byte) error
- func (c *Config) Validate() error
- type Factory
- type IceServerConfig
- func (m *IceServerConfig) CloneMessageVT() proto.Message
- func (m *IceServerConfig) CloneVT() *IceServerConfig
- func (*IceServerConfig) Descriptor() ([]byte, []int)deprecated
- func (this *IceServerConfig) EqualMessageVT(thatMsg proto.Message) bool
- func (this *IceServerConfig) EqualVT(that *IceServerConfig) bool
- func (m *IceServerConfig) GetCredential() isIceServerConfig_Credential
- func (x *IceServerConfig) GetOauth() *IceServerConfig_OauthCredential
- func (x *IceServerConfig) GetPassword() string
- func (x *IceServerConfig) GetUrls() []string
- func (x *IceServerConfig) GetUsername() string
- func (m *IceServerConfig) MarshalToSizedBufferVT(dAtA []byte) (int, error)
- func (m *IceServerConfig) MarshalToVT(dAtA []byte) (int, error)
- func (m *IceServerConfig) MarshalVT() (dAtA []byte, err error)
- func (*IceServerConfig) ProtoMessage()
- func (x *IceServerConfig) ProtoReflect() protoreflect.Message
- func (x *IceServerConfig) Reset()
- func (m *IceServerConfig) SizeVT() (n int)
- func (x *IceServerConfig) String() string
- func (c *IceServerConfig) ToICEServer() webrtc.ICEServer
- func (m *IceServerConfig) UnmarshalVT(dAtA []byte) error
- type IceServerConfig_Oauth
- func (m *IceServerConfig_Oauth) CloneVT() isIceServerConfig_Credential
- func (this *IceServerConfig_Oauth) EqualVT(thatIface isIceServerConfig_Credential) bool
- func (m *IceServerConfig_Oauth) MarshalToSizedBufferVT(dAtA []byte) (int, error)
- func (m *IceServerConfig_Oauth) MarshalToVT(dAtA []byte) (int, error)
- func (m *IceServerConfig_Oauth) SizeVT() (n int)
- type IceServerConfig_OauthCredential
- func (m *IceServerConfig_OauthCredential) CloneMessageVT() proto.Message
- func (m *IceServerConfig_OauthCredential) CloneVT() *IceServerConfig_OauthCredential
- func (*IceServerConfig_OauthCredential) Descriptor() ([]byte, []int)deprecated
- func (this *IceServerConfig_OauthCredential) EqualMessageVT(thatMsg proto.Message) bool
- func (this *IceServerConfig_OauthCredential) EqualVT(that *IceServerConfig_OauthCredential) bool
- func (x *IceServerConfig_OauthCredential) GetAccessToken() string
- func (x *IceServerConfig_OauthCredential) GetMacKey() string
- func (m *IceServerConfig_OauthCredential) MarshalToSizedBufferVT(dAtA []byte) (int, error)
- func (m *IceServerConfig_OauthCredential) MarshalToVT(dAtA []byte) (int, error)
- func (m *IceServerConfig_OauthCredential) MarshalVT() (dAtA []byte, err error)
- func (*IceServerConfig_OauthCredential) ProtoMessage()
- func (x *IceServerConfig_OauthCredential) ProtoReflect() protoreflect.Message
- func (x *IceServerConfig_OauthCredential) Reset()
- func (m *IceServerConfig_OauthCredential) SizeVT() (n int)
- func (x *IceServerConfig_OauthCredential) String() string
- func (o *IceServerConfig_OauthCredential) ToOauthCredential() webrtc.OAuthCredential
- func (m *IceServerConfig_OauthCredential) UnmarshalVT(dAtA []byte) error
- type IceServerConfig_Password
- func (m *IceServerConfig_Password) CloneVT() isIceServerConfig_Credential
- func (this *IceServerConfig_Password) EqualVT(thatIface isIceServerConfig_Credential) bool
- func (m *IceServerConfig_Password) MarshalToSizedBufferVT(dAtA []byte) (int, error)
- func (m *IceServerConfig_Password) MarshalToVT(dAtA []byte) (int, error)
- func (m *IceServerConfig_Password) SizeVT() (n int)
- type IceTransportPolicy
- func (IceTransportPolicy) Descriptor() protoreflect.EnumDescriptor
- func (x IceTransportPolicy) Enum() *IceTransportPolicy
- func (IceTransportPolicy) EnumDescriptor() ([]byte, []int)deprecated
- func (x IceTransportPolicy) Number() protoreflect.EnumNumber
- func (x IceTransportPolicy) String() string
- func (c IceTransportPolicy) ToICETransportPolicy() webrtc.ICETransportPolicy
- func (IceTransportPolicy) Type() protoreflect.EnumType
- type Link
- type WebRTC
- func (w *WebRTC) Close() error
- func (w *WebRTC) DialPeer(ctx context.Context, peerID peer.ID, addr string) (fatal bool, err error)
- func (w *WebRTC) Execute(ctx context.Context) error
- func (w *WebRTC) GetPeerDialer(ctx context.Context, peerID peer.ID) (*dialer.DialerOpts, error)
- func (w *WebRTC) GetPeerID() peer.ID
- func (w *WebRTC) GetUUID() uint64
- func (w *WebRTC) GetVerbose() bool
- func (w *WebRTC) MatchTransportType(transportType string) bool
- type WebRTCSignalHandler
- type WebRtcConfig
- func (m *WebRtcConfig) CloneMessageVT() proto.Message
- func (m *WebRtcConfig) CloneVT() *WebRtcConfig
- func (*WebRtcConfig) Descriptor() ([]byte, []int)deprecated
- func (this *WebRtcConfig) EqualMessageVT(thatMsg proto.Message) bool
- func (this *WebRtcConfig) EqualVT(that *WebRtcConfig) bool
- func (x *WebRtcConfig) GetIceCandidatePoolSize() uint32
- func (x *WebRtcConfig) GetIceServers() []*IceServerConfig
- func (x *WebRtcConfig) GetIceTransportPolicy() IceTransportPolicy
- func (m *WebRtcConfig) MarshalToSizedBufferVT(dAtA []byte) (int, error)
- func (m *WebRtcConfig) MarshalToVT(dAtA []byte) (int, error)
- func (m *WebRtcConfig) MarshalVT() (dAtA []byte, err error)
- func (*WebRtcConfig) ProtoMessage()
- func (x *WebRtcConfig) ProtoReflect() protoreflect.Message
- func (x *WebRtcConfig) Reset()
- func (m *WebRtcConfig) SizeVT() (n int)
- func (x *WebRtcConfig) String() string
- func (c *WebRtcConfig) ToWebRtcConfiguration() *webrtc.Configuration
- func (m *WebRtcConfig) UnmarshalVT(dAtA []byte) error
- type WebRtcIce
- func (m *WebRtcIce) CloneMessageVT() proto.Message
- func (m *WebRtcIce) CloneVT() *WebRtcIce
- func (*WebRtcIce) Descriptor() ([]byte, []int)deprecated
- func (this *WebRtcIce) EqualMessageVT(thatMsg proto.Message) bool
- func (this *WebRtcIce) EqualVT(that *WebRtcIce) bool
- func (x *WebRtcIce) GetCandidate() string
- func (m *WebRtcIce) MarshalToSizedBufferVT(dAtA []byte) (int, error)
- func (m *WebRtcIce) MarshalToVT(dAtA []byte) (int, error)
- func (m *WebRtcIce) MarshalVT() (dAtA []byte, err error)
- func (s *WebRtcIce) ParseICECandidateInit() (*webrtc.ICECandidateInit, error)
- func (*WebRtcIce) ProtoMessage()
- func (x *WebRtcIce) ProtoReflect() protoreflect.Message
- func (x *WebRtcIce) Reset()
- func (m *WebRtcIce) SizeVT() (n int)
- func (x *WebRtcIce) String() string
- func (m *WebRtcIce) UnmarshalVT(dAtA []byte) error
- func (s *WebRtcIce) Validate() error
- type WebRtcSdp
- func (m *WebRtcSdp) CloneMessageVT() proto.Message
- func (m *WebRtcSdp) CloneVT() *WebRtcSdp
- func (*WebRtcSdp) Descriptor() ([]byte, []int)deprecated
- func (this *WebRtcSdp) EqualMessageVT(thatMsg proto.Message) bool
- func (this *WebRtcSdp) EqualVT(that *WebRtcSdp) bool
- func (x *WebRtcSdp) GetSdp() string
- func (x *WebRtcSdp) GetSdpType() string
- func (x *WebRtcSdp) GetTxSeqno() uint64
- func (m *WebRtcSdp) MarshalToSizedBufferVT(dAtA []byte) (int, error)
- func (m *WebRtcSdp) MarshalToVT(dAtA []byte) (int, error)
- func (m *WebRtcSdp) MarshalVT() (dAtA []byte, err error)
- func (s *WebRtcSdp) ParseSDP() (*sdp.SessionDescription, error)
- func (s *WebRtcSdp) ParseSDPType() webrtc.SDPType
- func (*WebRtcSdp) ProtoMessage()
- func (x *WebRtcSdp) ProtoReflect() protoreflect.Message
- func (x *WebRtcSdp) Reset()
- func (m *WebRtcSdp) SizeVT() (n int)
- func (x *WebRtcSdp) String() string
- func (s *WebRtcSdp) ToSessionDescription() *webrtc.SessionDescription
- func (m *WebRtcSdp) UnmarshalVT(dAtA []byte) error
- func (s *WebRtcSdp) Validate() error
- type WebRtcSignal
- func (m *WebRtcSignal) CloneMessageVT() proto.Message
- func (m *WebRtcSignal) CloneVT() *WebRtcSignal
- func (*WebRtcSignal) Descriptor() ([]byte, []int)deprecated
- func (this *WebRtcSignal) EqualMessageVT(thatMsg proto.Message) bool
- func (this *WebRtcSignal) EqualVT(that *WebRtcSignal) bool
- func (m *WebRtcSignal) GetBody() isWebRtcSignal_Body
- func (x *WebRtcSignal) GetIce() *WebRtcIce
- func (x *WebRtcSignal) GetRequestOffer() uint64
- func (x *WebRtcSignal) GetSdp() *WebRtcSdp
- func (m *WebRtcSignal) MarshalToSizedBufferVT(dAtA []byte) (int, error)
- func (m *WebRtcSignal) MarshalToVT(dAtA []byte) (int, error)
- func (m *WebRtcSignal) MarshalVT() (dAtA []byte, err error)
- func (*WebRtcSignal) ProtoMessage()
- func (x *WebRtcSignal) ProtoReflect() protoreflect.Message
- func (x *WebRtcSignal) Reset()
- func (m *WebRtcSignal) SizeVT() (n int)
- func (x *WebRtcSignal) String() string
- func (m *WebRtcSignal) UnmarshalVT(dAtA []byte) error
- func (m *WebRtcSignal) Validate() error
- type WebRtcSignal_Ice
- func (m *WebRtcSignal_Ice) CloneVT() isWebRtcSignal_Body
- func (this *WebRtcSignal_Ice) EqualVT(thatIface isWebRtcSignal_Body) bool
- func (m *WebRtcSignal_Ice) MarshalToSizedBufferVT(dAtA []byte) (int, error)
- func (m *WebRtcSignal_Ice) MarshalToVT(dAtA []byte) (int, error)
- func (m *WebRtcSignal_Ice) SizeVT() (n int)
- type WebRtcSignal_RequestOffer
- func (m *WebRtcSignal_RequestOffer) CloneVT() isWebRtcSignal_Body
- func (this *WebRtcSignal_RequestOffer) EqualVT(thatIface isWebRtcSignal_Body) bool
- func (m *WebRtcSignal_RequestOffer) MarshalToSizedBufferVT(dAtA []byte) (int, error)
- func (m *WebRtcSignal_RequestOffer) MarshalToVT(dAtA []byte) (int, error)
- func (m *WebRtcSignal_RequestOffer) SizeVT() (n int)
- type WebRtcSignal_Sdp
- func (m *WebRtcSignal_Sdp) CloneVT() isWebRtcSignal_Body
- func (this *WebRtcSignal_Sdp) EqualVT(thatIface isWebRtcSignal_Body) bool
- func (m *WebRtcSignal_Sdp) MarshalToSizedBufferVT(dAtA []byte) (int, error)
- func (m *WebRtcSignal_Sdp) MarshalToVT(dAtA []byte) (int, error)
- func (m *WebRtcSignal_Sdp) SizeVT() (n int)
Constants ¶
const ConfigID = ControllerID
ConfigID is the string used to identify this config object.
const ControllerID = "bifrost/webrtc"
ControllerID is the WebRTC controller ID.
const TransportType = "webrtc"
TransportType is the transport type identifier for this transport.
const WebRTCSignalHandlerControllerID = ControllerID + "/signal-handler"
WebRTCSignalHandlerControllerID is the controller ID for WebRTCSignalHandler
Variables ¶
var ( IceTransportPolicy_name = map[int32]string{ 0: "IceTransportPolicy_ALL", 1: "IceTransportPolicy_RELAY", } IceTransportPolicy_value = map[string]int32{ "IceTransportPolicy_ALL": 0, "IceTransportPolicy_RELAY": 1, } )
Enum value maps for IceTransportPolicy.
var File_github_com_aperturerobotics_bifrost_transport_webrtc_webrtc_proto protoreflect.FileDescriptor
var SignalingCryptContext = "github.com/aperturerobotics/bifrost 2024-01-15 17:58:55 webrtc signaling"
SignalingCryptContext is the encryption context to use for the signaling messages.
var SignalingProtocolID protocol.ID = signaling.ProtocolID
SignalingProtocolID is the default protocol id to use for the signaling client.
var Version = semver.MustParse("0.0.1")
Version is the version of the implementation.
Functions ¶
func EncodeWebRtcSignal ¶
func EncodeWebRtcSignal(s *WebRtcSignal, dstPeer crypto.PubKey) ([]byte, error)
EncodeWebRtcSignal marshals and encrypts the WebRtcSignal message.
func NewLinkUUID ¶
NewLinkUUID builds the UUID for a link
Types ¶
type Config ¶
type Config struct { // SignalingId is the signaling channel identifier. // Cannot be empty. SignalingId string `protobuf:"bytes,1,opt,name=signaling_id,json=signalingId,proto3" json:"signaling_id,omitempty"` // TransportPeerId sets the peer ID to attach the transport to. // If unset, attaches to any running peer with a private key. // Must match the transport peer ID of the signaling transport. TransportPeerId string `protobuf:"bytes,2,opt,name=transport_peer_id,json=transportPeerId,proto3" json:"transport_peer_id,omitempty"` // TransportType overrides the transport type id for dial addresses. // Defaults to "webrtc" // Configures the scheme for addr matching to this transport. // E.x.: webrtc:// TransportType string `protobuf:"bytes,3,opt,name=transport_type,json=transportType,proto3" json:"transport_type,omitempty"` // Quic contains the quic protocol options. // // The WebRTC transport always disables FEC and several other UDP-centric // features which are unnecessary due to the "reliable" nature of WebRTC. Quic *quic.Opts `protobuf:"bytes,4,opt,name=quic,proto3" json:"quic,omitempty"` // WebRtc contains the WebRTC protocol options. WebRtc *WebRtcConfig `protobuf:"bytes,5,opt,name=web_rtc,json=webRtc,proto3" json:"web_rtc,omitempty"` // Backoff is the backoff config for connecting to a PeerConnection. // If unset, defaults to reasonable defaults. Backoff *backoff.Backoff `protobuf:"bytes,6,opt,name=backoff,proto3" json:"backoff,omitempty"` // Dialers maps peer IDs to dialers. // This allows mapping which peer ID should be dialed via this transport. Dialers map[string]*dialer.DialerOpts `` /* 155-byte string literal not displayed */ // AllPeers tells the transport to attempt to negotiate a WebRTC session with // any peer, even those not listed in the Dialers map. AllPeers bool `protobuf:"varint,8,opt,name=all_peers,json=allPeers,proto3" json:"all_peers,omitempty"` // DisableListen disables listening for incoming Links. // If set, we will only dial out, not accept incoming links. DisableListen bool `protobuf:"varint,9,opt,name=disable_listen,json=disableListen,proto3" json:"disable_listen,omitempty"` // BlockPeers is a list of peer ids that will not be contacted via this transport. BlockPeers []string `protobuf:"bytes,10,rep,name=block_peers,json=blockPeers,proto3" json:"block_peers,omitempty"` // Verbose enables very verbose logging. Verbose bool `protobuf:"varint,11,opt,name=verbose,proto3" json:"verbose,omitempty"` // contains filtered or unexported fields }
Config is the configuration for the WebRTC Signal RPC transport.
func (*Config) CloneMessageVT ¶
func (*Config) Descriptor
deprecated
func (*Config) EqualsConfig ¶
EqualsConfig checks if the other config is equal.
func (*Config) GetAllPeers ¶
func (*Config) GetBackoff ¶
func (*Config) GetBlockPeers ¶
func (*Config) GetConfigID ¶
GetConfigID returns the unique string for this configuration type. This string is stored with the encoded config.
func (*Config) GetDebugVals ¶
func (c *Config) GetDebugVals() config.DebugValues
GetDebugVals returns the directive arguments as key/value pairs. This should be something like param1="test", param2="test". This is not necessarily unique, and is primarily intended for display.
func (*Config) GetDialers ¶
func (x *Config) GetDialers() map[string]*dialer.DialerOpts
func (*Config) GetDisableListen ¶
func (*Config) GetSignalingId ¶
func (*Config) GetTransportPeerId ¶
func (*Config) GetTransportType ¶
func (*Config) GetVerbose ¶
func (*Config) GetWebRtc ¶
func (x *Config) GetWebRtc() *WebRtcConfig
func (*Config) MarshalToSizedBufferVT ¶
func (*Config) ParseBlockPeerIDs ¶
ParseBlockPeerIDs parses the remote peer IDs to not allow.
func (*Config) ParseTransportPeerID ¶
ParseTransportPeerID parses the node peer ID if it is not empty.
func (*Config) ProtoMessage ¶
func (*Config) ProtoMessage()
func (*Config) ProtoReflect ¶
func (x *Config) ProtoReflect() protoreflect.Message
func (*Config) SetTransportPeerId ¶
SetTransportPeerId sets the node peer ID field.
func (*Config) UnmarshalVT ¶
type Factory ¶
type Factory struct {
// contains filtered or unexported fields
}
Factory constructs the transport.
func (*Factory) Construct ¶
func (t *Factory) Construct( conf config.Config, opts controller.ConstructOpts, ) (controller.Controller, error)
Construct constructs the associated controller given configuration. The transport's identity (private key) comes from a GetNode lookup.
func (*Factory) ConstructConfig ¶
ConstructConfig constructs an instance of the controller configuration.
func (*Factory) GetConfigID ¶
GetConfigID returns the configuration ID for the controller.
func (*Factory) GetControllerID ¶
GetControllerID returns the unique ID for the controller.
func (*Factory) GetVersion ¶
GetVersion returns the version of this controller.
type IceServerConfig ¶
type IceServerConfig struct { // Urls is the list of URLs for the ICE server. // // Format: stun:{url} or turn:{url} or turns:{url}?transport=tcp // Examples: // - stun:stun.l.google.com:19302 // - stun:stun.stunprotocol.org:3478 // - turns:google.de?transport=tcp Urls []string `protobuf:"bytes,1,rep,name=urls,proto3" json:"urls,omitempty"` // Username is the username for the ICE server. Username string `protobuf:"bytes,2,opt,name=username,proto3" json:"username,omitempty"` // Credential contains the ice server credential, if any. // // Types that are assignable to Credential: // // *IceServerConfig_Password // *IceServerConfig_Oauth Credential isIceServerConfig_Credential `protobuf_oneof:"credential"` // contains filtered or unexported fields }
IceServer is a WebRTC ICE server config.
func (*IceServerConfig) CloneMessageVT ¶
func (m *IceServerConfig) CloneMessageVT() proto.Message
func (*IceServerConfig) CloneVT ¶
func (m *IceServerConfig) CloneVT() *IceServerConfig
func (*IceServerConfig) Descriptor
deprecated
func (*IceServerConfig) Descriptor() ([]byte, []int)
Deprecated: Use IceServerConfig.ProtoReflect.Descriptor instead.
func (*IceServerConfig) EqualMessageVT ¶
func (this *IceServerConfig) EqualMessageVT(thatMsg proto.Message) bool
func (*IceServerConfig) EqualVT ¶
func (this *IceServerConfig) EqualVT(that *IceServerConfig) bool
func (*IceServerConfig) GetCredential ¶
func (m *IceServerConfig) GetCredential() isIceServerConfig_Credential
func (*IceServerConfig) GetOauth ¶
func (x *IceServerConfig) GetOauth() *IceServerConfig_OauthCredential
func (*IceServerConfig) GetPassword ¶
func (x *IceServerConfig) GetPassword() string
func (*IceServerConfig) GetUrls ¶
func (x *IceServerConfig) GetUrls() []string
func (*IceServerConfig) GetUsername ¶
func (x *IceServerConfig) GetUsername() string
func (*IceServerConfig) MarshalToSizedBufferVT ¶
func (m *IceServerConfig) MarshalToSizedBufferVT(dAtA []byte) (int, error)
func (*IceServerConfig) MarshalToVT ¶
func (m *IceServerConfig) MarshalToVT(dAtA []byte) (int, error)
func (*IceServerConfig) MarshalVT ¶
func (m *IceServerConfig) MarshalVT() (dAtA []byte, err error)
func (*IceServerConfig) ProtoMessage ¶
func (*IceServerConfig) ProtoMessage()
func (*IceServerConfig) ProtoReflect ¶
func (x *IceServerConfig) ProtoReflect() protoreflect.Message
func (*IceServerConfig) Reset ¶
func (x *IceServerConfig) Reset()
func (*IceServerConfig) SizeVT ¶
func (m *IceServerConfig) SizeVT() (n int)
func (*IceServerConfig) String ¶
func (x *IceServerConfig) String() string
func (*IceServerConfig) ToICEServer ¶
func (c *IceServerConfig) ToICEServer() webrtc.ICEServer
ToICEServer converts the IceServerConfig to a webrtc.ICEServer.
func (*IceServerConfig) UnmarshalVT ¶
func (m *IceServerConfig) UnmarshalVT(dAtA []byte) error
type IceServerConfig_Oauth ¶
type IceServerConfig_Oauth struct { // Oauth contains an OAuth credential. Oauth *IceServerConfig_OauthCredential `protobuf:"bytes,4,opt,name=oauth,proto3,oneof"` }
func (*IceServerConfig_Oauth) CloneVT ¶
func (m *IceServerConfig_Oauth) CloneVT() isIceServerConfig_Credential
func (*IceServerConfig_Oauth) EqualVT ¶
func (this *IceServerConfig_Oauth) EqualVT(thatIface isIceServerConfig_Credential) bool
func (*IceServerConfig_Oauth) MarshalToSizedBufferVT ¶
func (m *IceServerConfig_Oauth) MarshalToSizedBufferVT(dAtA []byte) (int, error)
func (*IceServerConfig_Oauth) MarshalToVT ¶
func (m *IceServerConfig_Oauth) MarshalToVT(dAtA []byte) (int, error)
func (*IceServerConfig_Oauth) SizeVT ¶
func (m *IceServerConfig_Oauth) SizeVT() (n int)
type IceServerConfig_OauthCredential ¶
type IceServerConfig_OauthCredential struct { // MacKey is a base64-url format. MacKey string `protobuf:"bytes,1,opt,name=mac_key,json=macKey,proto3" json:"mac_key,omitempty"` // AccessToken is the access token in base64-encoded format. AccessToken string `protobuf:"bytes,2,opt,name=access_token,json=accessToken,proto3" json:"access_token,omitempty"` // contains filtered or unexported fields }
OauthCredential is an OAuth credential information for the ICE server.
func (*IceServerConfig_OauthCredential) CloneMessageVT ¶
func (m *IceServerConfig_OauthCredential) CloneMessageVT() proto.Message
func (*IceServerConfig_OauthCredential) CloneVT ¶
func (m *IceServerConfig_OauthCredential) CloneVT() *IceServerConfig_OauthCredential
func (*IceServerConfig_OauthCredential) Descriptor
deprecated
func (*IceServerConfig_OauthCredential) Descriptor() ([]byte, []int)
Deprecated: Use IceServerConfig_OauthCredential.ProtoReflect.Descriptor instead.
func (*IceServerConfig_OauthCredential) EqualMessageVT ¶
func (this *IceServerConfig_OauthCredential) EqualMessageVT(thatMsg proto.Message) bool
func (*IceServerConfig_OauthCredential) EqualVT ¶
func (this *IceServerConfig_OauthCredential) EqualVT(that *IceServerConfig_OauthCredential) bool
func (*IceServerConfig_OauthCredential) GetAccessToken ¶
func (x *IceServerConfig_OauthCredential) GetAccessToken() string
func (*IceServerConfig_OauthCredential) GetMacKey ¶
func (x *IceServerConfig_OauthCredential) GetMacKey() string
func (*IceServerConfig_OauthCredential) MarshalToSizedBufferVT ¶
func (m *IceServerConfig_OauthCredential) MarshalToSizedBufferVT(dAtA []byte) (int, error)
func (*IceServerConfig_OauthCredential) MarshalToVT ¶
func (m *IceServerConfig_OauthCredential) MarshalToVT(dAtA []byte) (int, error)
func (*IceServerConfig_OauthCredential) MarshalVT ¶
func (m *IceServerConfig_OauthCredential) MarshalVT() (dAtA []byte, err error)
func (*IceServerConfig_OauthCredential) ProtoMessage ¶
func (*IceServerConfig_OauthCredential) ProtoMessage()
func (*IceServerConfig_OauthCredential) ProtoReflect ¶
func (x *IceServerConfig_OauthCredential) ProtoReflect() protoreflect.Message
func (*IceServerConfig_OauthCredential) Reset ¶
func (x *IceServerConfig_OauthCredential) Reset()
func (*IceServerConfig_OauthCredential) SizeVT ¶
func (m *IceServerConfig_OauthCredential) SizeVT() (n int)
func (*IceServerConfig_OauthCredential) String ¶
func (x *IceServerConfig_OauthCredential) String() string
func (*IceServerConfig_OauthCredential) ToOauthCredential ¶
func (o *IceServerConfig_OauthCredential) ToOauthCredential() webrtc.OAuthCredential
ToOauthCredential converts to a webrtc credential.
func (*IceServerConfig_OauthCredential) UnmarshalVT ¶
func (m *IceServerConfig_OauthCredential) UnmarshalVT(dAtA []byte) error
type IceServerConfig_Password ¶
type IceServerConfig_Password struct { // Password contains the ICE server password. Password string `protobuf:"bytes,3,opt,name=password,proto3,oneof"` }
func (*IceServerConfig_Password) CloneVT ¶
func (m *IceServerConfig_Password) CloneVT() isIceServerConfig_Credential
func (*IceServerConfig_Password) EqualVT ¶
func (this *IceServerConfig_Password) EqualVT(thatIface isIceServerConfig_Credential) bool
func (*IceServerConfig_Password) MarshalToSizedBufferVT ¶
func (m *IceServerConfig_Password) MarshalToSizedBufferVT(dAtA []byte) (int, error)
func (*IceServerConfig_Password) MarshalToVT ¶
func (m *IceServerConfig_Password) MarshalToVT(dAtA []byte) (int, error)
func (*IceServerConfig_Password) SizeVT ¶
func (m *IceServerConfig_Password) SizeVT() (n int)
type IceTransportPolicy ¶
type IceTransportPolicy int32
IceTransportPolicy contains the set of allowed ICE transport policies.
const ( // IceTransportPolicy_ALL allows any kind of ICE candidate. IceTransportPolicy_IceTransportPolicy_ALL IceTransportPolicy = 0 // IceTransportPolicy_RELAY allows only media relay candidates (TURN). IceTransportPolicy_IceTransportPolicy_RELAY IceTransportPolicy = 1 )
func (IceTransportPolicy) Descriptor ¶
func (IceTransportPolicy) Descriptor() protoreflect.EnumDescriptor
func (IceTransportPolicy) Enum ¶
func (x IceTransportPolicy) Enum() *IceTransportPolicy
func (IceTransportPolicy) EnumDescriptor
deprecated
func (IceTransportPolicy) EnumDescriptor() ([]byte, []int)
Deprecated: Use IceTransportPolicy.Descriptor instead.
func (IceTransportPolicy) Number ¶
func (x IceTransportPolicy) Number() protoreflect.EnumNumber
func (IceTransportPolicy) String ¶
func (x IceTransportPolicy) String() string
func (IceTransportPolicy) ToICETransportPolicy ¶
func (c IceTransportPolicy) ToICETransportPolicy() webrtc.ICETransportPolicy
ToICETransportPolicy converts the IceTransportPolicy to a webrtc.ICETransportPolicy.
func (IceTransportPolicy) Type ¶
func (IceTransportPolicy) Type() protoreflect.EnumType
type WebRTC ¶
type WebRTC struct {
// contains filtered or unexported fields
}
WebRTC implements a WebRTC transport.
func NewWebRTC ¶
func NewWebRTC( ctx context.Context, le *logrus.Entry, b bus.Bus, conf *Config, pKey crypto.PrivKey, c transport.TransportHandler, ) (*WebRTC, error)
NewWebRTC builds a new WebRTC transport.
ServeHTTP is implemented and can be used with a standard HTTP mux. Optionally listens on an address.
func (*WebRTC) DialPeer ¶
func (w *WebRTC) DialPeer( ctx context.Context, peerID peer.ID, addr string, ) (fatal bool, err error)
DialPeer dials a peer given an address. The yielded link should be emitted to the transport handler. DialPeer should return nil if the link was established. DialPeer will then not be called again for the same peer ID and address tuple until the yielded link is lost. Returns fatal and error.
func (*WebRTC) GetPeerDialer ¶
GetPeerDialer returns the dialing information for a peer. Called when resolving EstablishLink. Return nil, nil to indicate not found or unavailable.
func (*WebRTC) GetVerbose ¶
GetVerbose gets if verbose logging is enabled.
func (*WebRTC) MatchTransportType ¶
MatchTransportType checks if the given transport type ID matches this transport. If returns true, the transport controller will call DialPeer with that tptaddr. E.x.: "udp-quic" or "ws"
type WebRTCSignalHandler ¶
type WebRTCSignalHandler struct {
// contains filtered or unexported fields
}
WebRTCSignalHandler handles incoming signaling messages from other peers.
This controller is usually started & managed by the WebRTC transport.
func NewWebRTCSignalHandler ¶
func NewWebRTCSignalHandler(t *WebRTC) *WebRTCSignalHandler
NewWebRTCSignalHandler constructs the WebRTCSignalHandler controller.
Listens for HandleSignalPeer directives and calls the transport.
func (*WebRTCSignalHandler) Close ¶
func (c *WebRTCSignalHandler) Close() error
Close releases any resources used by the controller. Error indicates any issue encountered releasing.
func (*WebRTCSignalHandler) Execute ¶
func (c *WebRTCSignalHandler) Execute(ctx context.Context) error
Execute executes the controller goroutine. Returning nil ends execution. Returning an error triggers a retry with backoff.
func (*WebRTCSignalHandler) GetControllerInfo ¶
func (c *WebRTCSignalHandler) GetControllerInfo() *controller.Info
GetControllerInfo returns information about the controller.
func (*WebRTCSignalHandler) HandleDirective ¶
func (c *WebRTCSignalHandler) HandleDirective(ctx context.Context, di directive.Instance) ([]directive.Resolver, error)
HandleDirective asks if the handler can resolve the directive. If it can, it returns resolver(s). If not, returns nil. It is safe to add a reference to the directive during this call. The passed context is canceled when the directive instance expires. NOTE: the passed context is not canceled when the handler is removed.
type WebRtcConfig ¶
type WebRtcConfig struct { // IceServers contains the list of ICE servers to use. IceServers []*IceServerConfig `protobuf:"bytes,1,rep,name=ice_servers,json=iceServers,proto3" json:"ice_servers,omitempty"` // IceTransportPolicy defines the policy for permitted ICE candidates. // Optional. IceTransportPolicy IceTransportPolicy `` /* 149-byte string literal not displayed */ // IceCandidatePoolSize defines the size of the prefetched ICE pool. // Optional. IceCandidatePoolSize uint32 `` /* 126-byte string literal not displayed */ // contains filtered or unexported fields }
WebRtcConfig configures the WebRTC PeerConnection.
func (*WebRtcConfig) CloneMessageVT ¶
func (m *WebRtcConfig) CloneMessageVT() proto.Message
func (*WebRtcConfig) CloneVT ¶
func (m *WebRtcConfig) CloneVT() *WebRtcConfig
func (*WebRtcConfig) Descriptor
deprecated
func (*WebRtcConfig) Descriptor() ([]byte, []int)
Deprecated: Use WebRtcConfig.ProtoReflect.Descriptor instead.
func (*WebRtcConfig) EqualMessageVT ¶
func (this *WebRtcConfig) EqualMessageVT(thatMsg proto.Message) bool
func (*WebRtcConfig) EqualVT ¶
func (this *WebRtcConfig) EqualVT(that *WebRtcConfig) bool
func (*WebRtcConfig) GetIceCandidatePoolSize ¶
func (x *WebRtcConfig) GetIceCandidatePoolSize() uint32
func (*WebRtcConfig) GetIceServers ¶
func (x *WebRtcConfig) GetIceServers() []*IceServerConfig
func (*WebRtcConfig) GetIceTransportPolicy ¶
func (x *WebRtcConfig) GetIceTransportPolicy() IceTransportPolicy
func (*WebRtcConfig) MarshalToSizedBufferVT ¶
func (m *WebRtcConfig) MarshalToSizedBufferVT(dAtA []byte) (int, error)
func (*WebRtcConfig) MarshalToVT ¶
func (m *WebRtcConfig) MarshalToVT(dAtA []byte) (int, error)
func (*WebRtcConfig) MarshalVT ¶
func (m *WebRtcConfig) MarshalVT() (dAtA []byte, err error)
func (*WebRtcConfig) ProtoMessage ¶
func (*WebRtcConfig) ProtoMessage()
func (*WebRtcConfig) ProtoReflect ¶
func (x *WebRtcConfig) ProtoReflect() protoreflect.Message
func (*WebRtcConfig) Reset ¶
func (x *WebRtcConfig) Reset()
func (*WebRtcConfig) SizeVT ¶
func (m *WebRtcConfig) SizeVT() (n int)
func (*WebRtcConfig) String ¶
func (x *WebRtcConfig) String() string
func (*WebRtcConfig) ToWebRtcConfiguration ¶
func (c *WebRtcConfig) ToWebRtcConfiguration() *webrtc.Configuration
ToWebRtcConfiguration converts the WebRtcConfig into a webrtc.Configuration.
func (*WebRtcConfig) UnmarshalVT ¶
func (m *WebRtcConfig) UnmarshalVT(dAtA []byte) error
type WebRtcIce ¶
type WebRtcIce struct { // Candidate contains the JSON-encoded ICE candidate. Candidate string `protobuf:"bytes,1,opt,name=candidate,proto3" json:"candidate,omitempty"` // contains filtered or unexported fields }
WebRtcIce contains an ICE candidate.
func NewWebRtcIce ¶
NewWebRtcIce constructs a new WebRtcIce from a ICECandidateInit.
func (*WebRtcIce) CloneMessageVT ¶
func (*WebRtcIce) Descriptor
deprecated
func (*WebRtcIce) EqualMessageVT ¶
func (*WebRtcIce) GetCandidate ¶
func (*WebRtcIce) MarshalToSizedBufferVT ¶
func (*WebRtcIce) ParseICECandidateInit ¶
ParseICECandidateInit parses the ICECandidate from the JSON encoded body.
func (*WebRtcIce) ProtoMessage ¶
func (*WebRtcIce) ProtoMessage()
func (*WebRtcIce) ProtoReflect ¶
func (x *WebRtcIce) ProtoReflect() protoreflect.Message
func (*WebRtcIce) UnmarshalVT ¶
type WebRtcSdp ¶
type WebRtcSdp struct { // TxSeqno is the sequence number of the transmitting peer. // The receiver should update the local seqno to match. TxSeqno uint64 `protobuf:"varint,1,opt,name=tx_seqno,json=txSeqno,proto3" json:"tx_seqno,omitempty"` // SdpType is the string encoded type of the sdp. // Examples: "offer" "answer" SdpType string `protobuf:"bytes,2,opt,name=sdp_type,json=sdpType,proto3" json:"sdp_type,omitempty"` // Sdp contains the WebRTC session description. Sdp string `protobuf:"bytes,3,opt,name=sdp,proto3" json:"sdp,omitempty"` // contains filtered or unexported fields }
WebRtcSdp contains the SDP offer or answer.
func NewWebRtcSdp ¶
NewWebRtcSdp constructs a new WebRtcSdp from a SessionDescription.
func (*WebRtcSdp) CloneMessageVT ¶
func (*WebRtcSdp) Descriptor
deprecated
func (*WebRtcSdp) EqualMessageVT ¶
func (*WebRtcSdp) GetSdpType ¶
func (*WebRtcSdp) GetTxSeqno ¶
func (*WebRtcSdp) MarshalToSizedBufferVT ¶
func (*WebRtcSdp) ParseSDP ¶
ParseSDP parses the SDP from the type and sdp fields.
Returns nil, nil if the message is empty.
func (*WebRtcSdp) ParseSDPType ¶
func (s *WebRtcSdp) ParseSDPType() webrtc.SDPType
ParseSDPType parses the SDP type field.
func (*WebRtcSdp) ProtoMessage ¶
func (*WebRtcSdp) ProtoMessage()
func (*WebRtcSdp) ProtoReflect ¶
func (x *WebRtcSdp) ProtoReflect() protoreflect.Message
func (*WebRtcSdp) ToSessionDescription ¶
func (s *WebRtcSdp) ToSessionDescription() *webrtc.SessionDescription
ToSessionDescription converts the sdp into a webrtc session description object.
Returns nil if the message is empty.
func (*WebRtcSdp) UnmarshalVT ¶
type WebRtcSignal ¶
type WebRtcSignal struct { // Body is the body of the message. // // Types that are assignable to Body: // // *WebRtcSignal_RequestOffer // *WebRtcSignal_Sdp // *WebRtcSignal_Ice Body isWebRtcSignal_Body `protobuf_oneof:"body"` // contains filtered or unexported fields }
WebRtcSignal is a WebRTC Signaling message sent via the Signaling channel.
func DecodeWebRtcSignal ¶
func DecodeWebRtcSignal(msg []byte, privKey crypto.PrivKey) (*WebRtcSignal, error)
DecodeWebRtcSignal decrypts and unmarshals the WebRtcSignal message.
func (*WebRtcSignal) CloneMessageVT ¶
func (m *WebRtcSignal) CloneMessageVT() proto.Message
func (*WebRtcSignal) CloneVT ¶
func (m *WebRtcSignal) CloneVT() *WebRtcSignal
func (*WebRtcSignal) Descriptor
deprecated
func (*WebRtcSignal) Descriptor() ([]byte, []int)
Deprecated: Use WebRtcSignal.ProtoReflect.Descriptor instead.
func (*WebRtcSignal) EqualMessageVT ¶
func (this *WebRtcSignal) EqualMessageVT(thatMsg proto.Message) bool
func (*WebRtcSignal) EqualVT ¶
func (this *WebRtcSignal) EqualVT(that *WebRtcSignal) bool
func (*WebRtcSignal) GetBody ¶
func (m *WebRtcSignal) GetBody() isWebRtcSignal_Body
func (*WebRtcSignal) GetIce ¶
func (x *WebRtcSignal) GetIce() *WebRtcIce
func (*WebRtcSignal) GetRequestOffer ¶
func (x *WebRtcSignal) GetRequestOffer() uint64
func (*WebRtcSignal) GetSdp ¶
func (x *WebRtcSignal) GetSdp() *WebRtcSdp
func (*WebRtcSignal) MarshalToSizedBufferVT ¶
func (m *WebRtcSignal) MarshalToSizedBufferVT(dAtA []byte) (int, error)
func (*WebRtcSignal) MarshalToVT ¶
func (m *WebRtcSignal) MarshalToVT(dAtA []byte) (int, error)
func (*WebRtcSignal) MarshalVT ¶
func (m *WebRtcSignal) MarshalVT() (dAtA []byte, err error)
func (*WebRtcSignal) ProtoMessage ¶
func (*WebRtcSignal) ProtoMessage()
func (*WebRtcSignal) ProtoReflect ¶
func (x *WebRtcSignal) ProtoReflect() protoreflect.Message
func (*WebRtcSignal) Reset ¶
func (x *WebRtcSignal) Reset()
func (*WebRtcSignal) SizeVT ¶
func (m *WebRtcSignal) SizeVT() (n int)
func (*WebRtcSignal) String ¶
func (x *WebRtcSignal) String() string
func (*WebRtcSignal) UnmarshalVT ¶
func (m *WebRtcSignal) UnmarshalVT(dAtA []byte) error
func (*WebRtcSignal) Validate ¶
func (m *WebRtcSignal) Validate() error
Validate validates the WebRtcSignal message.
type WebRtcSignal_Ice ¶
type WebRtcSignal_Ice struct { // Ice contains an ICE candidate. Ice *WebRtcIce `protobuf:"bytes,3,opt,name=ice,proto3,oneof"` }
func (*WebRtcSignal_Ice) CloneVT ¶
func (m *WebRtcSignal_Ice) CloneVT() isWebRtcSignal_Body
func (*WebRtcSignal_Ice) EqualVT ¶
func (this *WebRtcSignal_Ice) EqualVT(thatIface isWebRtcSignal_Body) bool
func (*WebRtcSignal_Ice) MarshalToSizedBufferVT ¶
func (m *WebRtcSignal_Ice) MarshalToSizedBufferVT(dAtA []byte) (int, error)
func (*WebRtcSignal_Ice) MarshalToVT ¶
func (m *WebRtcSignal_Ice) MarshalToVT(dAtA []byte) (int, error)
func (*WebRtcSignal_Ice) SizeVT ¶
func (m *WebRtcSignal_Ice) SizeVT() (n int)
type WebRtcSignal_RequestOffer ¶
type WebRtcSignal_RequestOffer struct { // RequestOffer requests a new offer from the offerer with the local session seqno. // Incremented when negotiation is needed (something changes about the session). RequestOffer uint64 `protobuf:"varint,1,opt,name=request_offer,json=requestOffer,proto3,oneof"` }
func (*WebRtcSignal_RequestOffer) CloneVT ¶
func (m *WebRtcSignal_RequestOffer) CloneVT() isWebRtcSignal_Body
func (*WebRtcSignal_RequestOffer) EqualVT ¶
func (this *WebRtcSignal_RequestOffer) EqualVT(thatIface isWebRtcSignal_Body) bool
func (*WebRtcSignal_RequestOffer) MarshalToSizedBufferVT ¶
func (m *WebRtcSignal_RequestOffer) MarshalToSizedBufferVT(dAtA []byte) (int, error)
func (*WebRtcSignal_RequestOffer) MarshalToVT ¶
func (m *WebRtcSignal_RequestOffer) MarshalToVT(dAtA []byte) (int, error)
func (*WebRtcSignal_RequestOffer) SizeVT ¶
func (m *WebRtcSignal_RequestOffer) SizeVT() (n int)
type WebRtcSignal_Sdp ¶
type WebRtcSignal_Sdp struct { // Sdp contains the sdp offer or answer. Sdp *WebRtcSdp `protobuf:"bytes,2,opt,name=sdp,proto3,oneof"` }
func (*WebRtcSignal_Sdp) CloneVT ¶
func (m *WebRtcSignal_Sdp) CloneVT() isWebRtcSignal_Body
func (*WebRtcSignal_Sdp) EqualVT ¶
func (this *WebRtcSignal_Sdp) EqualVT(thatIface isWebRtcSignal_Body) bool
func (*WebRtcSignal_Sdp) MarshalToSizedBufferVT ¶
func (m *WebRtcSignal_Sdp) MarshalToSizedBufferVT(dAtA []byte) (int, error)
func (*WebRtcSignal_Sdp) MarshalToVT ¶
func (m *WebRtcSignal_Sdp) MarshalToVT(dAtA []byte) (int, error)
func (*WebRtcSignal_Sdp) SizeVT ¶
func (m *WebRtcSignal_Sdp) SizeVT() (n int)