Documentation
¶
Overview ¶
Package core We will implement the popular open source project barrier kvm To ensure we can connect clients keyboard and mouse to the server while ScreenShare is taking place
Index ¶
- func BroadcastServerToBackend() error
- func DetectBarrier() error
- func EscapeNAT(ScreenPort, GameplayServerPort string) (ServerPort string, ScreenSharePort string, err error)
- func EscapeNATBarrier() (barrierKVMport string, err error)
- func GetHttp() *http.ServeMux
- func GetRandomName(retry int) string
- func Ip4or6(s string) string
- func RemoveRoom(id string)
- func StringPrettyPrint(data interface{}) (string, error)
- type Barrier
- type GameSession
- type Room
- type StreamSession
- type WSMessage
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BroadcastServerToBackend ¶
func BroadcastServerToBackend() error
BroadcastServerToBackend Broadcasts server information for the backend
func DetectBarrier ¶
func DetectBarrier() error
DetectBarrier This function ensures that the server has barrier client installed
func EscapeNAT ¶
func EscapeNAT(ScreenPort, GameplayServerPort string) (ServerPort string, ScreenSharePort string, err error)
EscapeNAT Func to escape NAT - 1 port for server - 2 port for barrierKVM
func EscapeNATBarrier ¶
func GetRandomName ¶
func Ip4or6 ¶
Ip4or6 Helper function to check if the IP address is IPV4 or IPV6 (https://socketloop.com/tutorials/golang-check-if-ip-address-is-version-4-or-6)
func RemoveRoom ¶
func RemoveRoom(id string)
func StringPrettyPrint ¶
StringPrettyPrint print the contents of the obj ( Reference: https://stackoverflow.com/questions/24512112/how-to-print-struct-variables-in-console
Types ¶
type Barrier ¶
Barrier It's preferred that the IP address used is a IPV6 address
func (*Barrier) CreateBarrierSession ¶
CreateBarrierSession Command to run "barrier.barrierc --debug INFO -f 192.168.0.175"
func (*Barrier) DeleteBarrierSession ¶
DeleteBarrierSession Deletes barrier client session running
type GameSession ¶
type GameSession struct {
Link string `json:"LinkID"`
Rate float64 `json:"Rate"`
Server *server.SysInfo `json:"ServerInformation"`
}
GameSession A single Game session. In the following implementation the server can have only 1 user occupying it por session.
type Room ¶
type Room struct {
ID string `json:"id"`
Sessions map[string]*StreamSession
CallerConn *websocket.Conn
BarrierSession *Barrier
}
func ReadRoomsFile ¶
ReadRoomsFile Reads rooms file and return struct room id
func (*Room) GetSession ¶
func (room *Room) GetSession(id string) *StreamSession
func (*Room) NewSession ¶
func (room *Room) NewSession(calleeConn *websocket.Conn) *StreamSession