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

@ -127,7 +127,7 @@ func (session *Session) SignalCandidate(data string) error {
return session.socket.Send(&message.SignalCandidate{
Event: event.SIGNAL_CANDIDATE,
Data: data,
});
})
}
func (session *Session) destroy() error {

View File

@ -1,9 +1,9 @@
package config
import (
"encoding/json"
"strconv"
"strings"
"encoding/json"
"github.com/spf13/cobra"
"github.com/spf13/viper"
@ -46,16 +46,15 @@ func (WebRTC) Init(cmd *cobra.Command) error {
return err
}
return nil
}
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

@ -95,7 +95,7 @@ func (manager *WebRTCManager) CreatePeer(id string, session types.Session) (stri
settings.SetEphemeralUDPPortRange(manager.config.EphemeralMin, manager.config.EphemeralMax)
settings.SetNAT1To1IPs(manager.config.NAT1To1IPs, webrtc.ICECandidateTypeHost)
settings.SetICETimeouts(6 * time.Second, 6 * time.Second, 3 * time.Second)
settings.SetICETimeouts(6*time.Second, 6*time.Second, 3*time.Second)
settings.SetSRTPReplayProtectionWindow(512)
// Create MediaEngine based off sdp
@ -142,12 +142,12 @@ func (manager *WebRTCManager) CreatePeer(id string, session types.Session) (stri
Msg("connection state has changed")
})
rtpVideo, err := connection.AddTrack(manager.videoTrack);
rtpVideo, err := connection.AddTrack(manager.videoTrack)
if err != nil {
return "", manager.config.ICELite, manager.config.ICEServers, err
}
rtpAudio, err := connection.AddTrack(manager.audioTrack);
rtpAudio, err := connection.AddTrack(manager.audioTrack)
if err != nil {
return "", manager.config.ICELite, manager.config.ICEServers, err
}
@ -230,7 +230,6 @@ func (manager *WebRTCManager) CreatePeer(id string, session types.Session) (stri
}
}()
return description.SDP, manager.config.ICELite, manager.config.ICEServers, nil
}

View File

@ -90,7 +90,6 @@ func (h *MessageHandler) Message(id string, raw []byte) error {
return h.controlKeyboard(id, session, payload)
}), "%s failed", header.Event)
// Chat Events
case event.CHAT_MESSAGE:
payload := &message.ChatReceive{}

View File

@ -10,10 +10,10 @@ import "C"
import (
"fmt"
"regexp"
"sync"
"time"
"unsafe"
"regexp"
"n.eko.moe/neko/internal/types"
)