2023-06-30 14:47:10 +00:00
|
|
|
package conf
|
|
|
|
|
2024-05-04 08:12:43 +00:00
|
|
|
import "encoding/json"
|
|
|
|
|
2023-06-30 14:47:10 +00:00
|
|
|
// WebRTCICEServer is a WebRTC ICE Server.
|
|
|
|
type WebRTCICEServer struct {
|
2024-04-06 16:32:53 +00:00
|
|
|
URL string `json:"url"`
|
|
|
|
Username string `json:"username"`
|
|
|
|
Password string `json:"password"`
|
|
|
|
ClientOnly bool `json:"clientOnly"`
|
2023-06-30 14:47:10 +00:00
|
|
|
}
|
2024-05-04 08:12:43 +00:00
|
|
|
|
|
|
|
// WebRTCICEServers is a list of WebRTCICEServer
|
|
|
|
type WebRTCICEServers []WebRTCICEServer
|
|
|
|
|
|
|
|
// UnmarshalJSON implements json.Unmarshaler.
|
|
|
|
func (s *WebRTCICEServers) UnmarshalJSON(b []byte) error {
|
|
|
|
// remove default value before loading new value
|
|
|
|
// https://github.com/golang/go/issues/21092
|
|
|
|
*s = nil
|
|
|
|
return json.Unmarshal(b, (*[]WebRTCICEServer)(s))
|
|
|
|
}
|