mirror of
https://github.com/pion/webrtc.git
synced 2025-10-22 22:59:31 +08:00

Modify RTCSdpType to protect newRTCSdpType Modify RTCPriorityType to protect methods Modify RTCSctpTransportState to protect methods Modify RTCRtcpMuxPolicy to protect methods Modify RTCPeerConnectionState to protect methods Modify RTCIceTransportPolicy to protect methods Modify RTCIceGatheringState to protect methods Modify RTCIceCredentialType to protect methods Modify RTCIceConnectionState to protect methods Modify RTCDtlsTransportState to protect methods Modify RTCDataChannelState to protect methods Modify RTCBundlePolicy to protect methods Relates to #83
44 lines
1.2 KiB
Go
44 lines
1.2 KiB
Go
package webrtc
|
|
|
|
// RTCIceCredentialType indicates the type of credentials used to connect to
|
|
// an ICE server.
|
|
type RTCIceCredentialType int
|
|
|
|
const (
|
|
// RTCIceCredentialTypePassword describes username and pasword based
|
|
// credentials as described in https://tools.ietf.org/html/rfc5389.
|
|
RTCIceCredentialTypePassword RTCIceCredentialType = iota + 1
|
|
|
|
// RTCIceCredentialTypeOauth describes token based credential as described
|
|
// in https://tools.ietf.org/html/rfc7635.
|
|
RTCIceCredentialTypeOauth
|
|
)
|
|
|
|
// This is done this way because of a linter.
|
|
const (
|
|
rtcIceCredentialTypePasswordStr = "password"
|
|
rtcIceCredentialTypeOauthStr = "oauth"
|
|
)
|
|
|
|
func newRTCIceCredentialType(raw string) RTCIceCredentialType {
|
|
switch raw {
|
|
case rtcIceCredentialTypePasswordStr:
|
|
return RTCIceCredentialTypePassword
|
|
case rtcIceCredentialTypeOauthStr:
|
|
return RTCIceCredentialTypeOauth
|
|
default:
|
|
return RTCIceCredentialType(Unknown)
|
|
}
|
|
}
|
|
|
|
func (t RTCIceCredentialType) String() string {
|
|
switch t {
|
|
case RTCIceCredentialTypePassword:
|
|
return rtcIceCredentialTypePasswordStr
|
|
case RTCIceCredentialTypeOauth:
|
|
return rtcIceCredentialTypeOauthStr
|
|
default:
|
|
return ErrUnknownType.Error()
|
|
}
|
|
}
|