Revert PLT-7809 (#7793)
* Update webrtc_test.go * Update webrtc.go * Update config.go * Update webrtc.go
Этот коммит содержится в:
коммит произвёл
Christopher Speller
родитель
1af182c198
Коммит
4731057e50
@@ -474,7 +474,6 @@ type NativeAppSettings struct {
|
||||
|
||||
type WebrtcSettings struct {
|
||||
Enable *bool
|
||||
GatewayType *string
|
||||
GatewayWebsocketUrl *string
|
||||
GatewayAdminUrl *string
|
||||
GatewayAdminSecret *string
|
||||
|
||||
@@ -11,24 +11,19 @@ import (
|
||||
type WebrtcInfoResponse struct {
|
||||
Token string `json:"token"`
|
||||
GatewayUrl string `json:"gateway_url"`
|
||||
GatewayType string `json:"gateway_type"`
|
||||
StunUri string `json:"stun_uri,omitempty"`
|
||||
TurnUri string `json:"turn_uri,omitempty"`
|
||||
TurnPassword string `json:"turn_password,omitempty"`
|
||||
TurnUsername string `json:"turn_username,omitempty"`
|
||||
}
|
||||
|
||||
type JanusGatewayResponse struct {
|
||||
type GatewayResponse struct {
|
||||
Status string `json:"janus"`
|
||||
}
|
||||
|
||||
type KopanoWebmeetingsResponse struct {
|
||||
Value string `json:"value"`
|
||||
}
|
||||
|
||||
func JanusGatewayResponseFromJson(data io.Reader) *JanusGatewayResponse {
|
||||
func GatewayResponseFromJson(data io.Reader) *GatewayResponse {
|
||||
decoder := json.NewDecoder(data)
|
||||
var o JanusGatewayResponse
|
||||
var o GatewayResponse
|
||||
err := decoder.Decode(&o)
|
||||
if err == nil {
|
||||
return &o
|
||||
@@ -56,13 +51,3 @@ func WebrtcInfoResponseFromJson(data io.Reader) *WebrtcInfoResponse {
|
||||
return nil
|
||||
}
|
||||
}
|
||||
|
||||
func KopanoWebmeetingsResponseFromJson(data io.Reader) *KopanoWebmeetingsResponse {
|
||||
decoder := json.NewDecoder(data)
|
||||
var o KopanoWebmeetingsResponse
|
||||
err := decoder.Decode(&o)
|
||||
if err == nil {
|
||||
return &o
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
@@ -27,20 +27,20 @@ func TestWebrtcInfoResponseToFromJson(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
func TestJanusGatewayResponseFromJson(t *testing.T) {
|
||||
func TestGatewayResponseFromJson(t *testing.T) {
|
||||
if testing.Short() {
|
||||
t.SkipNow()
|
||||
}
|
||||
|
||||
// Valid Gateway Response
|
||||
s1 := `{"janus": "something"}`
|
||||
g1 := JanusGatewayResponseFromJson(strings.NewReader(s1))
|
||||
g1 := GatewayResponseFromJson(strings.NewReader(s1))
|
||||
|
||||
CheckString(t, g1.Status, "something")
|
||||
|
||||
// Malformed JSON
|
||||
s2 := `{"wat"`
|
||||
g2 := JanusGatewayResponseFromJson(strings.NewReader(s2))
|
||||
g2 := GatewayResponseFromJson(strings.NewReader(s2))
|
||||
|
||||
if g2 != nil {
|
||||
t.Fatal("expected nil")
|
||||
|
||||
Ссылка в новой задаче
Block a user