go fmt whole project.
This commit is contained in:
@ -1,9 +1,9 @@
|
||||
package config
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
"strconv"
|
||||
"strings"
|
||||
"encoding/json"
|
||||
|
||||
"github.com/spf13/cobra"
|
||||
"github.com/spf13/viper"
|
||||
@ -42,10 +42,9 @@ func (WebRTC) Init(cmd *cobra.Command) error {
|
||||
}
|
||||
|
||||
cmd.PersistentFlags().String("iceservers", "", "describes a single STUN and TURN server that can be used by the ICEAgent to establish a connection with a peer")
|
||||
if err := viper.BindPFlag("iceservers", cmd.PersistentFlags().Lookup("iceservers")); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
if err := viper.BindPFlag("iceservers", cmd.PersistentFlags().Lookup("iceservers")); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
@ -53,9 +52,9 @@ func (WebRTC) Init(cmd *cobra.Command) error {
|
||||
func (s *WebRTC) Set() {
|
||||
s.ICELite = viper.GetBool("icelite")
|
||||
s.ICEServers = []webrtc.ICEServer{{URLs: viper.GetStringSlice("iceserver")}}
|
||||
if (viper.GetString("iceservers") != "") {
|
||||
if viper.GetString("iceservers") != "" {
|
||||
err := json.Unmarshal([]byte(viper.GetString("iceservers")), &s.ICEServers)
|
||||
if (err != nil) {
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
}
|
||||
|
@ -16,11 +16,11 @@ type Disconnect struct {
|
||||
}
|
||||
|
||||
type SignalProvide struct {
|
||||
Event string `json:"event"`
|
||||
ID string `json:"id"`
|
||||
SDP string `json:"sdp"`
|
||||
Lite bool `json:"lite"`
|
||||
ICE []webrtc.ICEServer `json:"ice"`
|
||||
Event string `json:"event"`
|
||||
ID string `json:"id"`
|
||||
SDP string `json:"sdp"`
|
||||
Lite bool `json:"lite"`
|
||||
ICE []webrtc.ICEServer `json:"ice"`
|
||||
}
|
||||
|
||||
type SignalAnswer struct {
|
||||
@ -30,8 +30,8 @@ type SignalAnswer struct {
|
||||
}
|
||||
|
||||
type SignalCandidate struct {
|
||||
Event string `json:"event"`
|
||||
Data string `json:"data"`
|
||||
Event string `json:"event"`
|
||||
Data string `json:"data"`
|
||||
}
|
||||
|
||||
type MembersList struct {
|
||||
@ -125,6 +125,6 @@ type BroadcastStatus struct {
|
||||
}
|
||||
|
||||
type BroadcastCreate struct {
|
||||
Event string `json:"event"`
|
||||
URL string `json:"url"`
|
||||
Event string `json:"event"`
|
||||
URL string `json:"url"`
|
||||
}
|
||||
|
@ -7,9 +7,9 @@ import (
|
||||
)
|
||||
|
||||
type Sample struct {
|
||||
Data []byte
|
||||
Timestamp time.Time
|
||||
Duration time.Duration
|
||||
Data []byte
|
||||
Timestamp time.Time
|
||||
Duration time.Duration
|
||||
}
|
||||
|
||||
type WebRTCManager interface {
|
||||
|
Reference in New Issue
Block a user