Archived
2
0

go fmt whole project.

This commit is contained in:
m1k1o
2021-04-04 22:37:33 +02:00
parent c7a178e5a4
commit f85d4d312f
14 changed files with 177 additions and 180 deletions

View File

@ -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)
}
}

View File

@ -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"`
}

View File

@ -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 {