From 29f67fad0681658f9f889fe8fb183440f9f50144 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miroslav=20=C5=A0ediv=C3=BD?= Date: Mon, 12 Sep 2022 22:18:18 +0200 Subject: [PATCH] move config from types. --- server/cmd/serve.go | 2 +- server/internal/capture/broadcast.go | 2 +- server/internal/capture/manager.go | 2 +- server/internal/{types => }/config/broadcast.go | 0 server/internal/{types => }/config/capture.go | 0 server/internal/{types => }/config/config.go | 0 server/internal/{types => }/config/desktop.go | 0 server/internal/{types => }/config/root.go | 0 server/internal/{types => }/config/server.go | 0 server/internal/{types => }/config/webrtc.go | 0 server/internal/{types => }/config/websocket.go | 0 server/internal/desktop/manager.go | 2 +- server/internal/http/http.go | 2 +- server/internal/types/desktop.go | 12 ++++++++++++ server/internal/types/xorg.go | 13 ------------- server/internal/webrtc/webrtc.go | 2 +- server/internal/websocket/websocket.go | 2 +- server/neko.go | 2 +- 18 files changed, 20 insertions(+), 21 deletions(-) rename server/internal/{types => }/config/broadcast.go (100%) rename server/internal/{types => }/config/capture.go (100%) rename server/internal/{types => }/config/config.go (100%) rename server/internal/{types => }/config/desktop.go (100%) rename server/internal/{types => }/config/root.go (100%) rename server/internal/{types => }/config/server.go (100%) rename server/internal/{types => }/config/webrtc.go (100%) rename server/internal/{types => }/config/websocket.go (100%) delete mode 100644 server/internal/types/xorg.go diff --git a/server/cmd/serve.go b/server/cmd/serve.go index 890c83d..b0d7c7d 100644 --- a/server/cmd/serve.go +++ b/server/cmd/serve.go @@ -5,7 +5,7 @@ import ( "github.com/spf13/cobra" "m1k1o/neko" - "m1k1o/neko/internal/types/config" + "m1k1o/neko/internal/config" ) func init() { diff --git a/server/internal/capture/broadcast.go b/server/internal/capture/broadcast.go index c3394ad..fb97c27 100644 --- a/server/internal/capture/broadcast.go +++ b/server/internal/capture/broadcast.go @@ -7,7 +7,7 @@ import ( "github.com/rs/zerolog/log" "m1k1o/neko/internal/capture/gst" - "m1k1o/neko/internal/types/config" + "m1k1o/neko/internal/config" ) type BroadcastManager struct { diff --git a/server/internal/capture/manager.go b/server/internal/capture/manager.go index d0494be..c53a3de 100644 --- a/server/internal/capture/manager.go +++ b/server/internal/capture/manager.go @@ -5,9 +5,9 @@ import ( "time" "m1k1o/neko/internal/capture/gst" + "m1k1o/neko/internal/config" "m1k1o/neko/internal/desktop/xorg" "m1k1o/neko/internal/types" - "m1k1o/neko/internal/types/config" "github.com/kataras/go-events" "github.com/rs/zerolog" diff --git a/server/internal/types/config/broadcast.go b/server/internal/config/broadcast.go similarity index 100% rename from server/internal/types/config/broadcast.go rename to server/internal/config/broadcast.go diff --git a/server/internal/types/config/capture.go b/server/internal/config/capture.go similarity index 100% rename from server/internal/types/config/capture.go rename to server/internal/config/capture.go diff --git a/server/internal/types/config/config.go b/server/internal/config/config.go similarity index 100% rename from server/internal/types/config/config.go rename to server/internal/config/config.go diff --git a/server/internal/types/config/desktop.go b/server/internal/config/desktop.go similarity index 100% rename from server/internal/types/config/desktop.go rename to server/internal/config/desktop.go diff --git a/server/internal/types/config/root.go b/server/internal/config/root.go similarity index 100% rename from server/internal/types/config/root.go rename to server/internal/config/root.go diff --git a/server/internal/types/config/server.go b/server/internal/config/server.go similarity index 100% rename from server/internal/types/config/server.go rename to server/internal/config/server.go diff --git a/server/internal/types/config/webrtc.go b/server/internal/config/webrtc.go similarity index 100% rename from server/internal/types/config/webrtc.go rename to server/internal/config/webrtc.go diff --git a/server/internal/types/config/websocket.go b/server/internal/config/websocket.go similarity index 100% rename from server/internal/types/config/websocket.go rename to server/internal/config/websocket.go diff --git a/server/internal/desktop/manager.go b/server/internal/desktop/manager.go index 2b950e3..8f4bf5e 100644 --- a/server/internal/desktop/manager.go +++ b/server/internal/desktop/manager.go @@ -4,9 +4,9 @@ import ( "sync" "time" + "m1k1o/neko/internal/config" "m1k1o/neko/internal/desktop/xorg" "m1k1o/neko/internal/types" - "m1k1o/neko/internal/types/config" "github.com/rs/zerolog" "github.com/rs/zerolog/log" diff --git a/server/internal/http/http.go b/server/internal/http/http.go index bb70243..21c9617 100644 --- a/server/internal/http/http.go +++ b/server/internal/http/http.go @@ -11,8 +11,8 @@ import ( "github.com/rs/zerolog" "github.com/rs/zerolog/log" + "m1k1o/neko/internal/config" "m1k1o/neko/internal/types" - "m1k1o/neko/internal/types/config" ) type Server struct { diff --git a/server/internal/types/desktop.go b/server/internal/types/desktop.go index ba05b95..2f8f381 100644 --- a/server/internal/types/desktop.go +++ b/server/internal/types/desktop.go @@ -1,5 +1,17 @@ package types +type ScreenSize struct { + Width int `json:"width"` + Height int `json:"height"` + Rate int16 `json:"rate"` +} + +type ScreenConfiguration struct { + Width int `json:"width"` + Height int `json:"height"` + Rates map[int]int16 `json:"rates"` +} + type DesktopManager interface { Start() Shutdown() error diff --git a/server/internal/types/xorg.go b/server/internal/types/xorg.go deleted file mode 100644 index dec5161..0000000 --- a/server/internal/types/xorg.go +++ /dev/null @@ -1,13 +0,0 @@ -package types - -type ScreenSize struct { - Width int `json:"width"` - Height int `json:"height"` - Rate int16 `json:"rate"` -} - -type ScreenConfiguration struct { - Width int `json:"width"` - Height int `json:"height"` - Rates map[int]int16 `json:"rates"` -} diff --git a/server/internal/webrtc/webrtc.go b/server/internal/webrtc/webrtc.go index 266c780..b43f4d1 100644 --- a/server/internal/webrtc/webrtc.go +++ b/server/internal/webrtc/webrtc.go @@ -14,8 +14,8 @@ import ( "github.com/rs/zerolog" "github.com/rs/zerolog/log" + "m1k1o/neko/internal/config" "m1k1o/neko/internal/types" - "m1k1o/neko/internal/types/config" ) func New(sessions types.SessionManager, capture types.CaptureManager, desktop types.DesktopManager, config *config.WebRTC) *WebRTCManager { diff --git a/server/internal/websocket/websocket.go b/server/internal/websocket/websocket.go index 372f9ff..29f908c 100644 --- a/server/internal/websocket/websocket.go +++ b/server/internal/websocket/websocket.go @@ -11,8 +11,8 @@ import ( "github.com/rs/zerolog" "github.com/rs/zerolog/log" + "m1k1o/neko/internal/config" "m1k1o/neko/internal/types" - "m1k1o/neko/internal/types/config" "m1k1o/neko/internal/types/event" "m1k1o/neko/internal/types/message" "m1k1o/neko/internal/utils" diff --git a/server/neko.go b/server/neko.go index 804fe69..d2ac3db 100644 --- a/server/neko.go +++ b/server/neko.go @@ -7,10 +7,10 @@ import ( "runtime" "m1k1o/neko/internal/capture" + "m1k1o/neko/internal/config" "m1k1o/neko/internal/desktop" "m1k1o/neko/internal/http" "m1k1o/neko/internal/session" - "m1k1o/neko/internal/types/config" "m1k1o/neko/internal/webrtc" "m1k1o/neko/internal/websocket"