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{ return session.socket.Send(&message.SignalCandidate{
Event: event.SIGNAL_CANDIDATE, Event: event.SIGNAL_CANDIDATE,
Data: data, Data: data,
}); })
} }
func (session *Session) destroy() error { func (session *Session) destroy() error {

View File

@ -1,9 +1,9 @@
package config package config
import ( import (
"encoding/json"
"strconv" "strconv"
"strings" "strings"
"encoding/json"
"github.com/spf13/cobra" "github.com/spf13/cobra"
"github.com/spf13/viper" "github.com/spf13/viper"
@ -46,16 +46,15 @@ func (WebRTC) Init(cmd *cobra.Command) error {
return err return err
} }
return nil return nil
} }
func (s *WebRTC) Set() { func (s *WebRTC) Set() {
s.ICELite = viper.GetBool("icelite") s.ICELite = viper.GetBool("icelite")
s.ICEServers = []webrtc.ICEServer{{URLs: viper.GetStringSlice("iceserver")}} 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) err := json.Unmarshal([]byte(viper.GetString("iceservers")), &s.ICEServers)
if (err != nil) { if err != nil {
panic(err) panic(err)
} }
} }

View File

@ -142,12 +142,12 @@ func (manager *WebRTCManager) CreatePeer(id string, session types.Session) (stri
Msg("connection state has changed") Msg("connection state has changed")
}) })
rtpVideo, err := connection.AddTrack(manager.videoTrack); rtpVideo, err := connection.AddTrack(manager.videoTrack)
if err != nil { if err != nil {
return "", manager.config.ICELite, manager.config.ICEServers, err return "", manager.config.ICELite, manager.config.ICEServers, err
} }
rtpAudio, err := connection.AddTrack(manager.audioTrack); rtpAudio, err := connection.AddTrack(manager.audioTrack)
if err != nil { if err != nil {
return "", manager.config.ICELite, manager.config.ICEServers, err 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 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) return h.controlKeyboard(id, session, payload)
}), "%s failed", header.Event) }), "%s failed", header.Event)
// Chat Events // Chat Events
case event.CHAT_MESSAGE: case event.CHAT_MESSAGE:
payload := &message.ChatReceive{} payload := &message.ChatReceive{}

View File

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